Integrate Google Ads
Describes how to integrate Google Ads with Optimizely Web Experimentation, create Optimizely Audiences based on ad campaigns and ad groups from Google Ads, target experiments based on your Google Ads referral data, and create personalized landing pages for your ads.
Optimizely integrates with Google Ads to 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 lets you define Optimizely Audiences based on your Google Ads referral data and deliver consistent experiences to customers from start to finish. Optimizely Web Experimentation currently supports integrating with a singe Google Ads account. Optimizely integrations are at the project level, so if you want to use multiple Google Ads accounts with Optimizely, you can create a new project and set up the Ads integration with the other accounts.
Note
The Google Ads integration is available with select Optimizely Web Experimentation plans.
Enable Ads in Optimizely Web Experimentation
-
Toggle the Google Ads integration to On.
-
Click Connect to Google Ads to confirm.
-
Sign in with the Google account you use to access Ads. Click Allow.

Note
If your Google Ads account does not contain any campaigns, the integration fails, and None displays on a blank webpage. Create at least one campaign in your Google Ads account before enabling the integration.
- If you signed in with an Ads Manager Account and manage multiple accounts, select the Ads account for Optimizely from a drop-down list.

Learn more about enabling the integration.
Add the Optimizely tracking template
Complete your setup by adding the Optimizely tracking template text snippet to your Google Ads tracking template. If you plan to use your Google Ads integration to target multiple experiments or campaigns, add the tracking template text snippet to all your Google Ads campaigns, ad groups, or ads.
The Optimizely tracking template text snippet:
{lpurl}?opti_ca={campaignid}&opti_ag={adgroupid}&opti_ad={creative}&opti_key={targetid}
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 does not affect your ads unless you already use the tracking template fields (
opti_key
,opti_ca
,opti_ag
, andopti_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 have conflicts with your existing tracking templates. Ensure that the final URL that directs to your landing page includes the Optimizely tracking template text snippet.
Note
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.
-
Log in to Google Ads and select Campaigns.Â
-
Add the Tracking template column and select Ad Groups. Click Columns and select Modify columns.
-
Add the Tracking Template column under Attributes. 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 does not trigger a re-approval process, but modifying the tracking template of ad creatives does. -
Identify the lowest level where you already have tracking templates.
The hierarchy of levels in Google Ads is:- Campaigns (highest level)
- Ad groups
- Ad creatives (lowest level)
To see if 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.
-
Open the tab of the lowest level where tracking is implemented.
-
Click the Tracking template column to reorder the rows. Select all rows that include a tracking template. Click Edit and select Change URL options.
-
Select Append text for the Action.
-
Paste the following tracking template text snippet into the Append text field:
{lpurl}?opti_ca={campaignid}&opti_ag={adgroupid}&opti_ad={creative}&opti_key={targetid}
-
Click Make changes to confirm.
-
Select rows that do not have a tracking template.
-
Click Edit, then Change URL options.
-
Paste the following text snippet into the field next to Set value:Â
{lpurl}?opti_ca={campaignid}&opti_ag={adgroupid}&opti_ad={creative}&opti_key={targetid}
- Click Make changes.
Create an audience using Ads
After you turn on the integration, you can create audiences in Optimizely that target your Google Ads campaigns. You can also add conditions to an existing audience.
- Go to the Audiences dashboard. Select an existing audience or click Create new audience. A Google Ads drop-down list displays.
- Drag and drop Ad Campaigns and Ad Groups to create new audiences in Optimizely.

Note
Removed and disabled campaigns and ad groups do not appear in the dropdown menu.
Test your integration
Use Optimizely’s Preview Mode as you build 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 are ready to test 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.Â
Your changes 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.
Troubleshoot issues
Why do I not see some of my campaigns, ad groups, or keywords listed in the Create new audience window?
Optimizely does not show disabled campaigns (and their corresponding ad groups) or disabled ad groups (and their corresponding keywords).
You can see only paused or enabled ad groups from paused or enabled campaigns, or keywords from eligible ad groups.
Updated about 1 month ago