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

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedGoogle analyticsGoogle analytics
New Post
10/10/2014 3:22 PM

When I started google analytics the following script appeared at the top of all my pages.

(function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + ''; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); Search )

How do I either hide this or get rid of this. It is not visible after you log in but since no log in is required I would like this not to be visible on every page 

New Post
10/12/2014 2:18 PM
How did you add tge Google Analytics code? By adding the UA-xxxxxxx code in website settings? Or did you past the Script code in the aspx file by yourself? I think the latest because if you use the settings in the Admin menu it normally is added by DNN in the page.
New Post
10/14/2014 3:38 AM

Hi John,

I think that Hans is correct.

Under the Admin (second tab) there is functionality called "Google Analytics". 

This is where you can copy and paste you GA code and script. This is the best way.

Hope this helps,



New Post
10/14/2014 4:26 AM
DNN injects the code automatically, as soon as you enter your GA code.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
New Post
10/14/2014 10:11 AM

Question related to Google Analytics... but more specifically Tag Manager... I had been placing this code in my default.ascx page:

var tp = (CDefault)Page; tp.FindControl("Body").Controls.AddAt(0, new Literal()


                Text = "<!-- Google Tag Manager --><script>dataLayer = [];</script><noscript><iframe src='//' height='0' width='0' style='display:none;visibility:hidden'></iframe></noscript><script>(function (w, d, s, l, i) { w[l] = w[l] || []; w[l].push({'gtm.start':new Date().getTime(), event: 'gtm.js'}); var f = d.getElementsByTagName(s)[0],j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src ='//' + i + dl; f.parentNode.insertBefore(j, f);})(window, document, 'script', 'dataLayer', 'GTM-5FM3P5');</script><!-- End Google Tag Manager -->"


 Which is fine, and added it right after the body tag... HOWEVER, it adds the SAME tag for ALL the portals... which is bad. 

Is there a way to identify the different portals here (say with an if statement, etc) that will allow me to have a different tag for each portal? 

Thanks in advance,



HomeHomeDevelopment and...Development and...Getting StartedGetting StartedGoogle analyticsGoogle analytics

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