This article will help you:
  • Integrate Google Universal Analytics to read data from Optimizely.
  • Add Google Universal Analytics integration code to your page.
  • Track Google Universal Analytics metrics as experiment goals.
  • Create custom dimensions and reports in Google Universal Analytics to track and report on Optimizely data.

If you use Google Universal Analytics (UA) to monitor your site's traffic, you can view the results of your Optimizely experiments alongside the rest of the data that Google UA collects.

Here are a few reasons to integrate:

  • Get a direct view of how Optimizely experiments affect the metrics you track in Google Analytics

  • See Google Analytics data for each variation in your experiment (or experience in a campaign)

  • Filter your Google Analytics reporting by visitors who were successfully included in an Optimizely experiment and exclude those who weren't

Looking for a different Google Analytics integration? See our Google Tag Manager article. To learn more, you can also check out these great write-ups by Geoff Kenyon, Trevor Fox, and our Solutions Partner Vertical Nerve.

You can also download a checklist to help you manage this procedure.


First, enable Google Analytics in your Optimizely project if you haven't already.

Here are a few other details to keep in mind:

  • To integrate Optimizely with Google UA, you'll need an available custom dimension in Google Analytics to populate with Optimizely experiment data.

  • Use the number (or index) of the custom dimension to configure and send data to your Optimizely experiment. To access your Google UA custom dimensions and create one for Optimizely, scroll down to the Create a Google UA custom dimension section below.

  • Use one custom dimension per concurrently running experiment or campaign to keep experiment names and variations from overwriting each other.

  • If your page's Google UA setting has the setDomainName function call on your page, make sure that it doesn't use a leading period or "www".

  • Your Optimizely experiment or campaign must be running for Google UA integration to work.

In Optimizely:

  • Your Optimizely and Google UA snippets can be placed in any order.

  • You do not need to make theactivateUniversalAnalyticsAPI call.

  • Optimizely does not send Optimizely data with the 'pageview'. It sends a separate 'non-interaction event', independent of the 'pageview'.