WordPress.org

Ready to get started?Download WordPress

Forums

Google Analytics by Yoast
Cookie Domain Error with Google Analytics Experiments (3 posts)

  1. cpwp13
    Member
    Posted 1 year ago #

    I have manually added Google Analytics Experiment code to my website, which is in addition to the Yoast-generated Google Analytics tracking code. When verifying the experiment code within Google Analytics, I get the following error:

    "Experiment code missing the cookie domain name declared in tracking code"

    However, I can't seem to find any domain name declared in the tracking code, which I've copied below (with an anonymized GA ID):

    <script type="text/javascript">//<![CDATA[
    			// Google Analytics for WordPress by Yoast v4.2.7 | http://yoast.com/wordpress/google-analytics/
    			var _gaq = _gaq || [];
    			_gaq.push(['_setAccount', 'UA-XXXXXXXX-1']);
    							_gaq.push(['_trackPageview']);
    			(function () {
    				var ga = document.createElement('script');
    				ga.type = 'text/javascript';
    				ga.async = true;
    				ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    				var s = document.getElementsByTagName('script')[0];
    				s.parentNode.insertBefore(ga, s);
    			})();
    			//]]></script>

    Any idea how to resolve the experiment code error?

    Thanks.

    http://wordpress.org/extend/plugins/google-analytics-for-wordpress/

  2. nikoza
    Member
    Posted 1 year ago #

    Have you managed to resolve this issue? I am facing the same thing!

  3. cpwp13
    Member
    Posted 1 year ago #

    Hey nikoza, I have managed to resolved this. Turns out the analytics code was being added to the site twice, once by Yoast and a second time by my Pagelines theme. One instance had the cookie domain declared and the other didn't. This is what was confusing the experiment code. I hope this helps.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.