Skip to content
  • Home
  • Developers
  • API
  • Releases
  • Community
  • University
  • Status
  • Home
  • Developers
  • API
  • Releases
  • Community
  • University
  • Status
Home Integrations A/B Testing & Personalization Google Optimize Integration
Session Replay Getting Started Administration Data Management Definitions Charts Analysis Examples Heap Plays Integrations Heap Connect Data Privacy

Table of Contents

Was this article helpful?

Yes No

Thank you for your feedback!

Google Optimize Integration

In this article you'll learn:

  • Step-by-step instructions to connect Heap and Google Optimize
  • Details on mapping property values to variations when sending data between Heap and Google Optimize
This doc is for: Admins Architects

Synchronous Loading Recommended

Loading Google Optimize asynchronously can cause inaccuracies in Heap data capture, as it may create a scenario where Heap loads first and misses experimentation data from before Google Optimize loaded. For this reason, we recommend setting up Google Optimize to load synchronously.

Overview

Heap’s Google Optimize integration automatically captures all active experiment variations as a Heap property attached to every event on a given page. With this source, you can answer questions like:

  • How does an A/B test impact long-term retention?
  • Do users exposed to an experiment convert faster than others?
  • Did a given experiment influence behavior that isn’t directly related to the functionality changed?

Heap currently supports only client-side implementations of Google Optimize.

Setup

To configure the Google Optimize source, you’ll need to have the following privileges:

  1. Admin or Architect privileges in Heap
  2. Access to your Google Optimize console

Turn on Google Optimize in Heap

To get started, click Set Up on the Google Optimize page. Once connected, Heap will automatically capture all active experiments and exposed variations as a property on all events for a given page.

By default, Heap will automatically capture all active Google Optimize experiments and attach a pageview-level property to all events on that page in the user’s experience (including custom events). The format of the property follows the pattern of Google Optimize: [Experiment Key] with the value of [Variation Number]. An example in this format might be: Google Optimize: yq-WQr_5T_iXAMF3MgZEtw as the property name and 0 or 1 as a value.

Map Google Optimize data through defined properties in Heap

To get the most value out of the Google Optimize source, you’ll want to map the experiment keys and variation numbers Heap autocaptures to a human-readable experiment, and variation names to be used in analysis. Please follow these steps to complete the process:

1) Access your experiment in Google Optimize

  • Log in to your Google Optimize account and select the corresponding Google Analytics container associated with the site Heap is capturing data on.
  • Select the experiment you’d like to map from the list of experiments. Once selected, you should see a view similar to the screenshot below:
Google Optimize Homepage Footer Tagline page

Not sure if your experiments are set up correctly? Google has a tool to help you check.

2) Define a new property in Heap

  • Within Heap, visit your properties view and click + New Property.
  • For the name of the property, please input the name of the experiment as shown in Google Optimize. For this example, we’ll enter Homepage Footer Tagline. For the ease of organization, you can also include the source name by titling the property Google Optimize: Homepage Footer Tagline.
The Homepage Footer Tagline page with the name field highlighted

3) Map the property values to variation names

  • Within the property creation view in Heap, please ensure that the property type is set to Event as the properties captured by this source are event-level properties (not user-level).
  • For the first case, select the property in Heap that corresponds with the ID of the experiment in Google Optimize. In our example, this is Google Optimize: yq-WQr_5T_iXAMF3MgZEtw. The ID can be found under the Measurement and objectives header of the experiment view in Google Optimize:
The Measurement and objectives section Id field highlighted

Complete the when clause by specifying when the aforementioned property is equal to to the first variation number in Google Optimize. To receive this variation number, click on any variation name within the Variants section of Google Optimize which will launch the Google Optimize experiment editor.

Within this view, click on the variation name drop-down in the top-left of the toolbar to see all variations associated with their variation number. In the example screenshot below, you can see our two variations Original and Answer Questions with their respective variation numbers 0 and 1:

The Homepage Footer Tagline view of the Heap homepage with Original highlighted
  • In this example, the first when statement should read: When Google Optimize: [experiment ID] is equal to 0.
  • To finalize the first variation mapping, you’ll need to enter the variation name as the constant value for this case. The entire case statement for this example should read: When Google Optimize: [experiment ID] is equal to 0 set value to a constant value Original.
  • Repeat the case definition process for any other experiment variations and save your property. A complete definition for this example would look like:
The Google Optimize: Homepage Footer Tagline as displayed in Heap

That’s it! You’re now able to use human-readable Google Optimize properties in analysis. You’ll need to repeat the property creation process entirely for any other experiments you’d like to map.

Once the mapping process is complete, you’ll now have a property available in Heap entitled Google Optimize: Experiment Name with the values of Variation Name that is attached to every page view where the experiment was active. This property will be available throughout all analysis in Heap!

Was this article helpful?

Yes No

Thank you for your feedback!

Last updated April 12, 2022.

google optimizegoogle optimize sourceintegration
  • Blog
  • Partners
  • Legal
  • Security
  • Terms
  • About
  • Careers
  • Privacy
  • Contact Us

© 2023 Heap, Inc.