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

  1. cpwp13
    Posted 3 years 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']);
    			(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);

    Any idea how to resolve the experiment code error?



  2. nikoza
    Posted 3 years ago #

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

  3. cpwp13
    Posted 3 years 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

  • Google Analytics by MonsterInsights
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.