Skip to main content


Optimizely Knowledge Base

Integrate Optimizely X with Google Ads

  • Integrate Google Ads with Optimizely
  • Create Optimizely Audiences based on ad campaigns and ad groups from Google Ads
  • Target experiments based on your Google Ads referral data
  • Create personalized landing pages for your ads

Optimizely integrates with Google Ads so you can connect your customer acquisition funnel to your conversion rate optimization. Use it to create symmetric messaging between your Google Ads creative content and your landing page, test the experience, and optimize for your paid traffic.

This integration allows you to define Optimizely Audiences based on your Google Ads referral data and deliver consistent experiences to customers from start to finish.

The Google Ads integration is available with select Optimizely X packages.

1. Enable Ads in Optimizely

Here's how to enable the integration:

1. Toggle the Google Ads integration to On. Click Connect to Google Ads to confirm.

adwords integration.jpg

2. Sign in with the Google account you use to access Ads. Click Allow.

If your Google Ads account does not contain any campaigns, the integration will fail and the text 'None' will be displayed on a blank webpage. Please create at least one campaign in your Google Ads account prior to enabling the integration.

3. If you signed in with an Ads Manager Account and manage multiple accounts, select the Ads account you’d like to leverage in Optimizely from a dropdown menu.

Optimizely currently supports integrating with a singular Ads Account. Optimizely Integrations are at the Project-level, so if you'd like to use multiple Ads accounts with Optimizely, you can create a new Project and set-up the Ads integration with the other accounts.

Great! You’ve turned on the Ads integration in Optimizely. Now you're ready finish setting up the integration in Ads.

2. Add the Optimizely tracking template to Ads

Complete your setup by adding the Optimizely tracking template text snippet to your Ads tracking template. If you plan to use your Ads integration to target multiple experiments or campaigns, you'll add the tracking template text snippet to all your Ads campaigns, ad groups, or ads.

For reference, here's the Optimizely tracking template text snippet:


We'll show you how to add it step-by-step, below.

A few things to know:

  • Lower-level tracking templates have priority over higher-level tracking templates. For example, if a tracking template exists for an individual ad creative, it overrides the tracking template of its higher-level ad group.

  • The tracking template text snippet has no effect on your Google Ads ads unless you're already using our tracking template fields (opti_key, opti_ca, opti_ag, and opti_ad) in your tracking templates. If your tracking template matches the entire referral URL, it may affect your page analytics.

  • If you use tracking templates for redirects (with {lpurl1}, {lpurl2}, and so on) or if you use multiple Google Ads management services, you may encounter conflicts with your existing tracking templates. If this is the case, please ensure that the final URL that directs to your landing page includes the Optimizely tracking template text snippet.

These are instructions for adding the Optimizely tracking template in the Google Ads interface. If you use a third-party service to manage your ad campaigns, insert the text snippet at the end of your tracking templates through that provider.

  1. Log in to Google Ads and select Campaigns

  2. Add the Tracking template column and select Ad Groups. Click Columns and select Modify columns.

  3. Under Attributes, add the Tracking Template column.

    Repeat this step for all Ads and Campaigns.

    For Campaigns, the Tracking Template column is under the Settings tab in Google Ads, not the Campaigns tab. Modifying the tracking template of campaigns or ad groups won't trigger a reapproval process, but modifying the tracking template of ad creatives will.

  4. Identify the lowest level where you already have tracking templates.

    The hierarchy of levels in Ads is:

    Campaigns (highest level)

    Ad Groups

    Ad Creatives (lowest level)

    To figure out whether you have tracking templates implemented on a certain level, select the tab for that level. Then, click the Tracking template column. If the column re-orders to show existing templates, you already have tracking templates on this level.

  5. Open the tab of the lowest level where tracking is implemented. For example, if Ad Groups is the lowest level where you have a tracking template, open the Ads groups tab.

  6. Click the Tracking template column to reorder the rows.

    Select all rows that include a tracking template. Then, click Edit and select Change URL options from the menu.

    If no rows contain tracking templates, skip to step 9.

  7. In the Action dropdown menu, select Append text.

  8. Paste the following tracking template text snippet into the Append text field:

  9. Click Make changes to confirm.

  10. Select all rows that don't have a tracking template. Click Edit, then Change URL options.

  11. Paste the following text snippet into the field next to Set value

  12. Click Make changes.

Congratulations! You successfully integrated Google Ads with Optimizely.

3. Create an audience using Ads

After you turn on the integration, you can create audiences in Optimizely that target your Ads campaigns. You can also add Ads conditions to an existing audience.

  1. Navigate to the Audiences dashboard. Select an existing audience or click Create new audience.

  2. In the Audiences dialog, you'll see a Google Ads dropdown.

  3. Drag and drop Ad Campaigns and Ad Groups to create new audiences in Optimizely.

    Removed and disabled campaigns and ad groups will not appear in the dropdown menu.

QA your integration

How do I make sure the integration is working as expected?
Use Optimizely’s Preview Mode as you're building an experiment to check that your variation looks the way you expect. Before you launch the experiment to visitors, verify that your tracking template is working by searching the URL for the terms used in the text snippet: opti_key, opti_ca, opti_ag, or opti_ad.

When you're ready to QA your audience targeting in a live environment without showing it to visitors, use the test cookie method to verify that your Ads audience conditions let the right visitors in.

When you set the test and tracking template live for all visitors, perform one final check by clicking the ad. It should allow you to be bucketed into the right variation. 

How long will it take before I see the changes go live?
Your changes will go live when all of the following conditions are met:

  • Your targeted Ads campaigns or ad groups are enabled and approved by Google

  • You have inserted the tracking template text snippet into the required tracking templates

  • Your Optimizely campaign is live


Why don't I see some of my campaigns, ad groups, or keywords listed in the Create new audience dialog?

Optimizely doesn’t show disabled campaigns (and their corresponding ad groups) or disabled ad groups (and their corresponding keywords).

You’ll only be able to see paused or enabled ad groups from paused or enabled campaigns, or keywords from eligible ad groups.