Notifications and Errors

Experiments Set-up: Code-checking Errors

This information applies to the Classic Analytics JavaScript (ga.js) only. Find out if you’re using Classic or Universal Analytics or learn how to upgrade from Classic Analytics to Universal Analytics.

This article includes:

  • Some general guidelines to help you avoid difficulties when you're setting up your experiments.

  • The errors that Content Experiments generates when it checks the code on your pages, and steps you can take to remedy those errors.

General Guidelines

Check your pages to make sure:

  • You placed the experiment code (generated during the third step of configuration) right after the opening head tag in the HTML of your original page

  • You placed the Google Analytics tracking code for the same view right after the opening head tag in the HTML of your variation pages

  • All pages in your experiment are live and publicly accessible (i.e., they’re not password protected or similarly blocked)

Code-Checking Errors

More than one control script found here: [locations list]

Issue: Your original page appears to have more than one instance of experiment code. This can happen if you reuse pages from previous experiments.

Solution: Check the HTML of your original page to make sure there is only one instance of the experiment code, and that the code is the same as what was generated in step three of your experiment configuration.

No control snippet found

Issue: The HTML of your original page needs to have the experiment code immediately after the opening head tag.

Solution: Make sure that you’ve copied the correct code for your experiment, that you’ve copied the entire experiment code, and that you’ve put it right after the opening head tag in the HTML of your original page.

Experiment code found after the Google Analytics tracking code

Issue: Your page has the Google Analytics tracking code before the experiment code. This can cause a problem with your experiment.

Solution: Move the experiment code so it comes before the Google Analytics tracking code. In general, the experiment code should be right after the opening head tag.

Control script for the wrong experiment found here: [locations list]

Issue: Your original page does not have the code for this experiment (generated in step three of experiment configuration).

Solution: Make sure that you’ve copied the correct code for your experiment, that you’ve copied the entire experiment code, and that you’ve put it in the correct section of your original page. Also make sure that there is no code from previous experiments on this page.

Invalid multivariate experiment tags found here: [locations of tags]

Issue: We no longer support multivariate testing, so these tags are probably leftover from a previous experiment.

Solution: In the HTML of your page, go to the lines specified in the error message and remove the tags.

Cookie customization below the experiment code found here: {$locations}

Your page has cookie-customization code after the experiment code. Cookie-customization code needs to appear before the experiment code. Move the cookie-customization code so it appears before the experiment code.

Learn more about cookie customization.

Cookie domain name inconsistency found here: {$locations}

The custom-cookie domain name in your page's experiment code does not match the custom-cookie domain name in its Analytics tracking code. Make sure the custom-cookie domain names match.

Learn more about cookie customization.

Cookie path inconsistency found here: {$locations}

The custom-cookie path in the experiment code does not match the custom-cookie path in the Analytics tracking code on this page. Make sure the custom cookie paths match.

Learn more about cookie customization.

Experiment code missing the cookie domain name declared in tracking code: {$locations}

The Analytics tracking code on this page customizes the cookie domain name; the experiment code on this page does not. Either remove the cookie customization from the tracking code or add it to the experiment code.

Learn more about cookie customization.

Experiment code missing the cookie path declared in tracking code: {$locations}

The Analytics tracking code on your page includes a customized cookie path; the experiment code does not include this customization. Either remove the cookie customization from the tracking code or add it to the experiment code.

Learn more about cookie customization.

Tracking code missing the cookie domain name declared in experiment code: {$locations}

The experiment code on this page customizes the cookie domain name; the Analytics tracking code on this page does not. Either remove the cookie customization from the experiment code or add it to the Analytics tracking code.

Learn more about cookie customization.

Tracking code missing the cookie path declared in experiment code: {$locations}

The experiment code on your page includes a customized cookie path; the Analytics tracking code does not include this customization. Either remove the cookie customization from the experiment code or add it to the Analytics tracking code.

Learn more about cookie customization.

No Google Analytics tracking script found

Issue: Your experiment page does not have Google Analytics tracking code installed.

Solution: In the HTML of your page, paste the Google Analytics tracking code immediately before the closing head tag.

Google Analytics web property ID number not recognized

Issue: Your page appears to use code that has a Google Analytics web property ID that is not related to this experiment. This can occur if you’ve reused this page from a previous experiment or incorrectly copied HTML from another page.

Solution: Delete your experiment code from this page, then copy your new experiment code and paste it again.

Urchin-style scripts found

Issue: Your page appears to use JavaScript tags that are no longer generated for Google Analytics. While these Urchin.js tags work, changing to the most current version of Analytics tracking code can help your pages load faster.

Solution: Remove this code from your page and replace it with the newest Google Analytics tracking code.

No link to official Google Analytics tracking code found

Issue: Content Experiments could not find a link to the official Google Analytics tracking code on your page. This is usually because the code was incorrectly copied. This can also happen when you modify the code to point to an unofficial URL (which we allow, but cannot validate as working).

Solution: Copy and paste the code again on this page.

Old experiment tracking script found here: [location of script]

Issue: Your page has code from an old experiment.

Solution: Remove the old code but leave the new experiment code.

Incomplete or old control script found here: [locations list]

Issue: Your original page either has code from a previous experiment or has incomplete code from this experiment.

Solution: Search your page for old experiment code, and remove it. In addition, make sure that you’ve copied the correct code for your experiment, that you’ve copied all the code, and that you’ve put it in the correct section of your original page.

Control script for another experiment found here: [locations list]

Issue: Your variation or conversion page has code for a different experiment.

Solution: Search your pages for old code and remove it.

Unnecessary control script found here: [locations list]

Issue: You have experiment code on a variation page.

Solution: Remove any experiment code from your variation pages.

Server problem

Issue: We couldn’t connect to the server where your web pages are located.

Solution: Make sure your pages are live and have the experiment code installed.

This page has too many redirects

Issue: Your conversion page redirects to another page, or your variation pages redirect multiple times.

Solution: Make sure your conversion page doesn’t redirect, and that your variation pages do not lead to multiple redirects. In addition, make sure you’ve entered the correct URL for your pages during step one of the experiment configuration.

We don’t check pages larger than 1 MB

Issue: We don’t scan pages larger than 1 MB, so we were unable to check if this page has working code.

Solution: Take a close look at your pages’ HTML to make sure you’ve pasted the correct code.

Could not find script in first 256KB of page

Issue: We only scan the first 256KB of any experiment page, and we did not find experiment or tracking code in the first 256KB.

Solution: In the HTML of the relevant page, move the code up to immediately after the opening head tag.

DNS error with your server

Issue: We encountered a DNS lookup error while trying to connect to the server for your web pages.

Solution: Check that your site is active, and that you entered the correct URLs in step one of experiment configuration.

Sorry – there’s a problem on our end

Issue: Something’s gone wrong and we’re working to fix the issue.

Solution: Wait a few minutes, then try checking your pages again.

Error message from your server

Issue: We couldn’t connect to the server that hosts your experiment pages. This problem usually results because you entered the wrong page URLs during setup, or the pages require sign-in to view.

Solution: First, make sure that your website is available. If your pages are live and publicly accessible, check that you entered the correct URLs in step one of the experiment configuration.

Too many validation requests

Issue: We only accept a certain number of requests to check pages in a given period. This sometimes happens if you’ve checked your experiment pages multiple times.

Solution: Wait a few minutes, then check your pages again.

Problem accessing page

Issue: We don’t know what caused this issue.

Solution: Check to see if your pages are live and properly tagged, then check that the URLs you entered during setup are correct.

Control script not in <head> section

Issue: The experiment code is not immediately after the opening head tag in your original page’s HTML.

Solution: In the original page’s HTML, move the experiment code you got in step three of your configuration to immediately after the opening head tag. Then check your pages again.

Experiment code missing the cookie domain-hash setting declared in tracking code: {$locations}.

Issue: The tracking code on your page customizes the cookie domain-hash setting while the experiment code on this page does not.

Solution:Either remove the cookie customization from the tracking code or add it to the experiment code. Learn more about cookie customization

Tracking code missing the cookie domain-hash setting declared in experiment code: {$locations}.

Issue: The experiment code on your page customizes the cookie domain hash but the tracking code on this page does not.

Solution: Either remove the cookie customization from the experiment code or add it to the tracking code. Learn more about cookie customization

Cookie domain-hash setting inconsistency found here: {$locations}.

Issue: The custom domain hash in your page's experiment code does not match the custom domain hash in your page's tracking code.

Solution: Make sure the custom domain hashes match. Learn more about cookie customization