Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Add script in <head> section of the website Add script in <head> section of the website
Previous
 
Next
New Post
5/28/2015 4:43 AM
 

I like to add some script (Google Analytics Javascript) in the <head> section of the website.

I know I can add the script in the "Page Header Tags" of a page but I like to add it once for the entire website.
Alternative is the Will Strohl Script Injection module and display the module on all pages but content manager can delete the module.

I think this should be a section under the "Site Settings" but for now I can't find it, so I assume it isn't there.

Anyone with a better solution? 


Willem Bonekamp - Webdeveloper/Projectmanager - I have been building Web Solutions using DNN from the beginning in 2002

DNN Services: Websites | Design | Skinning | Custom Modules | Hosting | SEO | Mobilty | DNN Nederland
 
New Post
5/28/2015 8:21 AM
 

Are you unable to use the Google Analytics Setting from the Admin Advanced area? 

Google Analytics in DNN

 
New Post
5/28/2015 8:45 AM
 

I need this code in the head:
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXX');
ga('require', 'displayfeatures');
ga('send', 'pageview');
setTimeout(“ga(‘send’,’event’,’real bounce rate‘,’page visit 10 seconds or more‘)”,10000);

So where do I put this code, I only have 2 fields: Tracking ID and URL Parameter?


Willem Bonekamp - Webdeveloper/Projectmanager - I have been building Web Solutions using DNN from the beginning in 2002

DNN Services: Websites | Design | Skinning | Custom Modules | Hosting | SEO | Mobilty | DNN Nederland
 
New Post
5/28/2015 8:58 AM
 

Are you customizing the Google Analytics script? If you're not customizing the script then you can just put the tracking ID in the Tracking ID field and the rest of the script will be generated for you. Just insert the ID, Save, then view the page source for your page and you will see the script there. 

If you are customizing the tracking script to account for some specific parameters then you would either use the parameters field or you could potentially include that script in the skin file and then inject it into the head via jQuery.

 
New Post
5/28/2015 9:40 AM
 
Tried the parameter field but doesn't work for this script... Maybe in the skin is the best solutions for now...
Do you think DNN can make a section under "Site Settings" to include javascript in the head of the website (every page)?


Willem Bonekamp - Webdeveloper/Projectmanager - I have been building Web Solutions using DNN from the beginning in 2002

DNN Services: Websites | Design | Skinning | Custom Modules | Hosting | SEO | Mobilty | DNN Nederland
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Add script in <head> section of the website Add script in <head> section of the website


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out