G Suite is now Google Workspace: everything your business needs to get work done.

Google Optimize

Set up an Optimize tag with Tag Manager.

Google Optimize and Optimize 360 will no longer be available after September 30, 2023. Your experiments and personalizations can continue to run until that date. Any experiments and personalizations still active on that date will end.

We launched Google Optimize over 5 years ago to enable businesses of all sizes to easily test and improve your user experiences. We remain committed to enabling businesses of all sizes to improve your user experiences and are investing in A/B testing in Google Analytics 4.

Learn more about the Optimize sunset

Google Optimize allows you to test variants of web pages and see how they perform against an objective that you specify. It monitors the performance of your experiment, and tells you which variant is best.

Before you begin this configuration in Tag Manager, ensure that your web page code is ready to handle Google Optimize tags:

  • For best results, implement the JavaScript portion of your Tag Manager container snippet as high in the <head> of the page as possible. Learn more.
  • Install the Optimize anti-flicker snippet on pages where Optimize will be deployed.
  • Ensure that any dataLayer declarations appear before the Optimize page-hiding snippet and Tag Manager container snippet. Learn more.

Tag setup

  1. Sign in to Tag Manager and select an account.
  2. Click Tags > New.
  3. Click Tag Configuration > Google Optimize.
  4. Enter your Optimize container ID, which you can find under Container details in the container settings in Optimize.
  5. Optional: Expand More Settings and open the Domain Settings dropdown to choose the domain from which you want to install Google Optimize. We recommend using the default www.googleoptimize.com domain for better performance and to avoid being throttled. However, choose the www.google-analytics.com domain if you already configured this domain in your Content Security Policy.
  6. Optional: (Universal Analytics only) Select Override global function name (Universal Analytics only) to rename the global object in Universal Analytics using a Google Analytics Settings variable. The Google Analytics Settings variable for the Optimize tag must match the global function name for the Universal Analytics tag. Learn more about renaming the global object.
  7. Save the tag without triggers. Note: The pageview trigger must be configured in the Analytics tag that will fire the Optimize tag.
  8. Enable tag sequencing:
    1. Open the Google Analytics: Universal Analytics or Google Analytics: GA4 Configuration tag for the Analytics property linked to your Optimize container.
    2. Click Tag Configuration > Advanced Settings > Tag Sequencing.
    3. Check the box to fire a tag before this tag fires. Under the Setup Tag heading, click the menu and select the desired Optimize tag.
    4. Configure the Optimize tag to fire once per page, then save it.
  9. Publish your Tag Manager container for the changes to take effect.
Important: Use Google Analytics Settings variables to ensure consistency between your Optimize and Analytics tags.
Was this helpful?
How can we improve it?
Clear search
Close search
Google apps
Main menu
Search Help Center