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 articles on implementing Google Analytics Classic or Google Analytics for iOS. Or, go to 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.

Troubleshooting your Google UA integration or seeing discrepancies in your reports? See our GA troubleshooting article.


Ready to get started? First, you'll need to enable Google Analytics.

Here's how:

  1. Navigate to the Home page and select the Integrations tab.

  2. Select Google Universal Analytics and toggle it On.

    That's it!

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. The custom dimension in Google Analytics is not the same as the Optimizely feature.

  • In Optimizely Classic, place the Google UA tracking code at the bottom of the <head> section of your pages. The integration won't work properly unless the Optimizely snippet is above the Google UA snippet.

  • 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 you have 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.

  • As long as you're testing on the same domain and Optimizely is implemented on the experiment page, you can track session-wide goals in Google UA.