Google Optimize will no longer be available after September 30, 2023. Your experiments and personalizations can continue to run until that date. Learn more

Installation diagnostics

A series of diagnostics to ensure that Optimize is configured properly.

Websites with a dynamic page structure (e.g. AJAX manipulating the DOM) can prevent changes made in the Optimize visual editor from firing. This can happen when, for example, JavaScript modifies the page after the Optimize snippet loads, or when the page is modified during progressive rendering and CSS selectors no longer match the same elements (creating a potential race condition). Optimize includes diagnostics that alert you when problems are detected with dynamic pages.

How it works

The Optimize visual editor automatically checks to ensure that your installation is optimal each time you use it. You can verify your Optimize installation at any time by clicking Run Diagnostics in the experiment information panel. A diagnostic message appears in the header of the experiment details page or experiment information panel (pictured below) when an issue is detected.

Optimize container types

  • Stored containers include all draft, scheduled, running, and ended experiences created in a container and contribute to the overall "stored container" size. To reduce the size of a stored container, archive some ended experiments.
  • Served containers only include the running experiences and the data is compressed. To reduce the size of a served container, end some of its experiences.

Diagnostic alerts

Following is a list of installation diagnostic messages with instructions on how to address them.

Errors Warnings Suggestions

Warning Errors

Optimize plugin not found

The web page doesn't have the Optimize plugin installed. You can still use the visual editor to create variants, but you can't use Preview mode to test them and visitors won't see your experiment. To run an experiment, you must first install Optimize.

Note: The "Optimize plugin not found" error can occur if you use ad/tracking blocker extensions, even if the page is correctly tagged with the Optimize plugin.

No GA4 measurement ID found

The web page is not tagged with a Google Analytics web stream. You need to install the web stream on your website.

Unexpected GA4 measurement ID found

The web page is tagged with a Google Analytics web stream, but the measurement ID is not the one configured for this experiment. Make sure you're using the right measurement ID.

Analytics tracking code not found

The web page is not tagged with Google Analytics tracking code for the Analytics property configured for this experiment. You won't be able to measure usage of your site nor monitor the performance of Optimize experiments. To run experiments, you must first install the Analytics tracking code (Google tag (gtag.js) for Google Analytics 4, Google tag (gtag.js) for Universal Analytics, or analytics.js).

Note: The "Analytics tracking code not found" error can occur if you use ad/tracking blocker extensions, even if the page is correctly tagged with the Analytics tracking code.

Analytics pageview not detected

This page isn't sending pageviews to Google Analytics. You won't be able to measure usage of your site or monitor performance of Optimize experiments. Make sure that your Analytics tracking code (the Google tag (gtag.js) for Google Analytics 4, Google tag (gtag.js) for Universal Analytics, or analytics.js) is set up correctly.

Unsupported Analytics tracking code found

The page is tracked with the legacy Google Analytics (ga.js) tracking code which isn't supported by Optimize. Update your Google Analytics tracking code to the Google tag (for Google Analytics 4), Google tag (for Universal Analytics), or analytics.js to use Optimize.

DataLayer variable in anti-flicker snippet reassigned

The anti-flicker snippet works by referencing a dataLayer variable that can be shared between Google Tag Manager containers and Optimize containers on a page. This can occur when the dataLayer variable gets re-initialized later on the page. That can happen when you have a Google Tag Manager snippet later on the page and you initialize the dataLayer variable again instead of updating its values. The Optimize tagging best practice is to move the dataLayer initialization above the anti-flicker snippet and to ensure that you don't re-initialize it later on the page. Less commonly, this diagnostic can occur when there is a syntax error in the anti-flicker snippet or the anti-flicker snippet has been commented out in your source code. Learn more about Using a Data Layer on Google Developers.

DataLayer variable name mismatch

The dataLayer variable used in the anti-flicker snippet is different from the variable used to load the container. This can happen when the Optimize plugin is installed via Google Tag Manager but it uses a different dataLayer variable name. You must use the same dataLayer variable name for both Tag Manager and the anti-flicker snippet.

Wrong Google Analytics tracker used to load Optimize

The Google Analytics code used to load the Optimize container is configured with a different Analytics property than the property linked to this Optimize container. This may cause some experiment measurements to be lost. Learn more about how to link to an Analytics property and how to troubleshoot linking.

Legacy Optimize snippet

You're using a legacy Optimize snippet that isn't supported. Upgrade your Optimize plugin using the instructions in Deploy Optimize.

Analytics configuration mismatch

All Analytics tracking code on your page must have the same tracker configuration settings. This is important a) if you use Google Tag Manager to fire Analytics hits, and you use hard-coded Analytics + Optimize code to deploy Optimize, or b) if you deploy Analytics and Optimize tags via Tag Manager. If you deploy Optimize via a Tag Manager tag, the best practice is to use the shared Google Analytics Settings variable in Tag Manager, which ensures your tracker settings match between tags.

The following fields must have the same value in both Tag Manager and Analytics:


Example: How to compare if a config is matching or not:

ga.getAll().forEach(tracker => console.log( `name: ${tracker.get("name")} trackingId: ${tracker.get("trackingId")} cookieDomain: ${tracker.get("cookieDomain")} allowLinker: ${tracker.get("allowLinker")}`))

Note: If you misconfigure your tracker settings, your Analytics data may not report as expected. For example, a mismatch in ‘cookieDomain’ or ‘allowLinker’ fields may result in self referrals or over-counting sessions, because this field is used for sub and cross-domain tracking in Google Analytics. Note that experiments can be measured across domains with proper cross-domain tracking setup, but a single experiment can't be executed across domains.

Information Warnings

Use Google Optimize domain

The default tag from Google Tag Manager uses the domain. However, we recommend that you select the Load the Optimize snippet from the domain checkbox to avoid being throttled and blocked by certain browsers. Learn more about installing Optimize with Google Tag Manager.

Anti-flicker snippet timed out

The anti-flicker snippet might not be configured correctly or the timeout value is too short. The anti-flicker timeout is a worst-case scenario. Your page will only be hidden for the full timeout if the experiment cannot execute sooner (and when it does, the page is unhidden immediately). When anti-flicker times out, your experiment doesn't run on that page load, which can limit the efficacy of your experiment and results. Regardless of timeout value, ensure that the Optimize plugin is deployed correctly and not late in the page (e.g. in the <BODY>).

Anti-flicker snippet configuration

The Optimize container is loaded via Google Tag Manager. The anti-flicker snippet should be configured to use the Tag Manager container ID, not the Optimize container ID. While this won't cause a problem when always firing the Optimize tag, it can adversely affect your site performance when you stop firing it, or if you fire it conditionally. In this case the best practice is to use the Tag Manager container ID in the anti-flicker snippet.

Anti-flicker snippet not in HEAD

The anti-flicker snippet must be installed near the top of the <HEAD> element of your web page, right after the dataLayer variable is initialized. Do not install the anti-flicker snippet through a tag management system (TMS) or another asynchronous script. The anti-flicker snippet needs to run before the page is displayed in order to function properly, otherwise you may experience flicker or the performance of your site may be adversely affected.

Non-standard anti-flicker snippet

A non-standard anti-flicker snippet was detected. The anti-flicker snippet shouldn't be installed via Google Tag Manager, other tag management system or asynchronous script. The anti-flicker snippet needs to run before the page is displayed in order to function properly, otherwise you may experience flicker and performance of your site can be impacted.

Remind me Suggestions

Anti-flicker snippet not found

You haven't installed the anti-flicker snippet and your visitors may experience page flicker, where they briefly see the original page before your experiment loads. This can skew your experiment results and confuse visitors.

Anti-flicker snippet timed out too fast

The anti-flicker snippet timeout value is too short. When anti-flicker times out, your experiment doesn't run, decreasing the amount of visitors that will see it. The anti-flicker timeout value is designed as a worst case scenario, not the actual time that your page will be hidden.

Optimize plugin not in HEAD

For best performance, the snippet that loads the Optimize plugin (whether it's Google Tag Manager or optimize.js) should be installed in the <HEAD> element of your web page, immediately after the anti-flicker snippet. The Deploy Optimize help center article and tagging best practices section contain more information on the best way to deploy Optimize.

Was this helpful?
How can we improve it?
Clear search
Close search
Google apps
Main menu
Search Help Center