relevant products:
  • Optimizely X Web Experimentation
  • Optimizely X Web Personalization
  • Optimizely X Web Recommendations

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

 
Tip:

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.

Prerequisites

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 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.

If you've been using the integration for Optimizely CLassic, we've made a few updates in Optimizely X:

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

  • You no longer need to make theactivateUniversalAnalyticsAPI call (but it's a good idea to keep it if you're still using Optimizely Classic.

  • Optimizely X no longer sends Optimizely data with the 'pageview'. It sends a separate 'non-interaction event', independent of the 'pageview'.