DotNetNuke 5.6.0 Bug in Google Analytics Module No Hits

The Problem

We found that after updating to DNN 5.6.0 that the hits on Google Analytics dropped to 0 Page Views.


We looked at the reason behind the problem with 0 hits being reported. What we found was that the code that Google states we should use on the page (and was working fine in DNN 5.5.1) is now not valid in 5.6.0.

The tracking code for us looks like this:


<script type=”text/javascript”>

var _gaq = _gaq || [];
_gaq.push([‘_setAccount’, ‘UA-1111111-1’]);

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


When we looked at the rendered source code on the DNN 5.6.0 website, we found that the code was different in the line:

_gaq.push([‘_setAccount’, ‘UA-1111111-1‘]);

Note the “” marks around the ID Number.

So this was someone’s buggy code from DNN Corp.   In the file: SiteAnalytics.config file.


The Fix

To fix the problem, is as simple as undoing the buggy code.

in the root directory of your site, is a file called:  SiteAnalytics.config

Open this file in your text editor to reveal:

<?xml version=”1.0″ encoding=”utf-8″ ?>
<EngineType>DotNetNuke.Services.Analytics.GoogleAnalyticsEngine, DotNetNuke</EngineType>

<script type=”text/javascript”>
var _gaq = _gaq || [];
_gaq.push([‘_setAccount’, [TRACKING_ID] ]);

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


Just replace the two quotation marks highlighted above “” with single ‘’  one either side of the two [ ]and save the file. This will fix the buggy code.

So the line becomes:

_gaq.push([‘_setAccount’, [TRACKING_ID] ]);


Notes on DNN 5.6.1

Originally we suggested that the “” be taken out. We then found after updating the 5.6.1 that the removal of the “” broke that upgrade with regard to Google Analytics. So we have modified these notes to say to replace the “” with single ‘’.


Side Note

We stayed stable on DNN 4.9.5 for some time, enjoying not having DNN broken each time we updated. Finally we bit the bullet and with much pain, a Code Expert, a Server Admin Expert and the help of Hyper V rollback capability we updated to DNN 5.x.

Now we are finding ourselves back in the game of undoing crap code every time we run a DNN update. Yes there are some great shiny new features, but we just blew 2 man days working out bugs in the UrlRewriter system and now this analytics bug.

This is disappointing and annoying to again be on this roundabout!

SiteAnalytics – Download File


Posted by InteractiveWebs

This blog is the combined blog work of the InteractiveWebs Dev Team. Together we work on a range of DotNetNuke (DNN) applications, modules, Silverlight, and Microsoft CRM Portal integration products.

Our Business is website design and hosting, with a strong focus on DotNetNuke, Microsoft Dynamics CRM, Silverlight and iPhone iPad development.


Eric Pontbriand

Thanks for this post.. was a big help and saved us much time.

You may find it interesting that DNN 5.6 breaks XHTML 1.0 Transitional validation with some kind of crazy link tags it adds to all the content zones. This is part of some “Google” enhancements “they” rolled out with the update.

We had to do a version rollback to 5.3 which was quite comical indeed just to have our sites validate again.


No problem. We have stuck with 5.6.0 but it has been one of the more buggy updates for a long time.

So are you saying that [TRACKING_ID] should not have any quotes around it at all, neither single or double quotes?



Björn Persson

Thank you for the information!

We are about to drop DotNetNuke and move to commercial CMS (EPiServer). It might cost money, but it’s worth not having to find out that this or that has stopped working.


Thank you! I noticed our Analytics numbers dropped like a rock after upgrading to 5.6. Thankfully, I ran across your comment on CodePlex about this issue and just fixed it. FWIW, in my SiteAnalytics.config file, the ID had single quotes around it (as opposed to the double-quotes you show in your post) but removing those produced the same result. Now I just have to wait until tomorrow to see if Analytics starts recording our numbers again.


As it turns out Ray, the removal of the “” was not a good idea, as it broke the update to 5.6.1 in relation to Analytics. We too have changed the advice to replacing with ”. Thanks for the feedback.

[…] If you suffer the cruel affliction of a DotNetNuke website, you may find your Google Analytics charts flat lined around November or December of 2010. DotNetNuke 5.6 introduced a bug in the analytics code, fortunately, the guys from Interactive Webs have published a solution. […]

You can’t get rid of the double quotes in my version -05.06.00 (459)-
There were single quotes in the config file, but it seems the double quotes are generated in code.
Now I deleted the singles and let’s hope I see tracking data tomorrow.


Did it work?

Leave a Reply