Running a Content Experiment but not seeing any data?

Last months I had quite some clients that started a content experiment but didn't see data comming in:

In almost all those cases the solution was pretty easy: they had a custom Google Analytics code for multiple domain tracking. And that means you need to make some changes to the Content Experiments script also. This is an example of a changed Google Analytics tracking code:

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_setDomainName', 'example.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setCookiePath, '/folder']);
_gaq.push(['_trackPageview']);

And this is the NEW Content Experiment code you need to get both scripts aligned:

<script>
_udn="example.com";
_utcp="/folder";
</script>
<!-- Google Analytics Content Experiment code -->
<script>function utmx_section(){}function utmx(){}(function(){var
k='XXXXXX-0',d=document,l=d.location,c=d.cookie;
if(l.search.indexOf('utm_expid='+k)>0)return;
function f(n){if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.
indexOf(';',i);return escape(c.substring(i+n.length+1,j<0?c.
length:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;d.write(
'<sc'+'ript src="'+'http'+(l.protocol=='https:'?'s://ssl':
'://www')+'.google-analytics.com/ga_exp.js?'+'utmxkey='+k+
'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='+new Date().
valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
'" type="text/javascript" charset="utf-8"><\/sc'+'ript>')})();
</script><script>utmx('url','A/B');</script>
<!-- End of Google Analytics Content Experiment code -->

The first script block (line 1-4) is the addition that does the trick. Copy your setDomainName value to the _udn parameter and do the same for the cookiePath.

Did this fix work for you?

Click to activate social bookmarks