---
updatedAt: 2026-07-23T10:46:12.000Z
---

Fetch the complete documentation index at: https://docs.developers.optimizely.com/web-experimentation/llms.txt. Use this file to discover all available pages before exploring further. Append .md to any documentation page URL to get its markdown version.

# Integrate Google Ads

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.

> 📘 Note
>
> This is a third-party integration and is not an Optimizely subprocessor. See Optimizely's <Anchor label="Third-Party Add-Ons & Platform Integration Terms" target="_blank" href="https://www.optimizely.com/legal/third-party-add-ons-platform-integration-terms/">Third-Party Add-Ons & Platform Integration Terms</Anchor>.

Optimizely Web Experimentation 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 Web Experimentation [audiences](https://support.optimizely.com/hc/en-us/articles/4410289218189) based on your Google Ads referral data and deliver consistent experiences to customers from start to finish. Web Experimentation currently supports integrating with a single 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 project and set up the Ads integration with the other accounts.

## Enable Ads in Web Experimentation

1. Go to **Settings > Integrations > Google Ads**.
2. Toggle on the integration and click **Accept**.
3. Click **Sign In with Google** to connect your account.

   <Image align="center" src="https://files.readme.io/191f39c-Google_Ads.png" />
4. Select your Google account and click **Continue**.
5. Select the checkbox next to **See, edit, create, and delete your Google Ads accounts and data** and click **Continue**.

<Image align="center" className="border" border={true} src="https://files.readme.io/4220925-Access_GoogleAds.png" />

> 📘 Note
>
> If your Google Ads account does not contain any campaigns, the integration fails, and an Internal Server Error displays. Before enabling the integration, create at least one campaign in your Google Ads account.

4. Select the Ads account for Optimizely from a drop-down list if you signed in with an [Ads Manager Account](https://www.google.com/adwords/manager-accounts/) and manage multiple accounts.

Learn more about [enabling the integration](https://docs.developers.optimizely.com/web-experimentation/docs/integrations#enable-an-integration-in-optimizely).

## Add the Optimizely tracking template

Add the Optimizely tracking template text snippet to your Google Ads tracking template. If you use your Google Ads integration to target multiple experiments or campaigns, add the tracking template text snippet to 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.

* `opti_ca`, `opti_ag`, and `opti_ad` are required and must have values. If `opti_key` exists, the snippet looks for the string and adds the digits to `opti_ag` to create a keyword. For example, if `opti_key` is *kwd-5678* and `opti_ag` is *1234*, then the resulting keyword is *1234:5678*.
* 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`, 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), you may have conflicts with your existing tracking templates if you use multiple Google Ads management services. 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.

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

4. 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)\
     Select the tab for that level to see if you have tracking templates implemented on a certain level. Then, click the **Tracking Template** column. If the column reorders to show existing templates, you already have tracking templates.

5. Open the tab of the lowest level where tracking is implemented.

6. Click the **Tracking template** column to reorder the rows. Select rows that include a tracking template. Click **Edit** and select **Change URL options**.

7. Select **Append text** for the **Action**.

8. Paste the following tracking template text snippet into the **Append text** field:
   ```text
   {lpurl}?opti_ca={campaignid}&opti_ag={adgroupid}&opti_ad={creative}&opti_key={targetid}
   ```

9. Click **Make changes** to confirm.

10. Select rows that do not have a tracking template.

11. Click **Edit**, then **Change URL options**.

12. Paste the following text snippet into the field next to **Set value**: 

```text
{lpurl}?opti_ca={campaignid}&opti_ag={adgroupid}&opti_ad={creative}&opti_key={targetid}
```

13. Click **Make changes**.

## Create an audience using Ads

After you turn on the integration, you can create [audiences](https://support.optimizely.com/hc/en-us/articles/4410289218189) in Optimizely that target your Google Ads campaigns. You can also add conditions to an existing audience.

1. Go to the **Audiences** dashboard. Select an existing audience or click **Create new audience**. A Google Ads drop-down list displays.
2. Drag and drop **Ad Campaigns** and **Ad Groups** to create audiences in Optimizely.

> 📘 Note
>
> Removed and disabled campaigns and ad groups do not display in the drop-down list.

## Test your integration

Use Optimizely’s [Preview Mode](https://support.optimizely.com/hc/en-us/articles/4410289461133) as you build an experiment to check that your variation looks how you expect. Before you launch the experiment to visitors, verify that your tracking template works 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](https://support.optimizely.com/hc/en-us/articles/4410283942413) to verify that your Ads audience conditions let the right visitors in.

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

Your changes go live when 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 on the Create new audience page?**

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.

**I have configured the integration with Google Ads, but I am not getting bucketed into the test.**

Confirm that you have the `opti_ca`, `opti_ag`, and `opti_ad` parameters in the snippet, as mentioned in [Test your integration](https://docs.developers.optimizely.com/web-experimentation/docs/configure-google-ads#test-your-integration).

The snippet adds data for the campaign and ad group if `opti_ca`, `opti_ag`, and `opti_ad` exist and for keywords if these parameters plus the additional `opti_key` exist.

Your tracking URL should look like this, *\&opti\_ca=17953774510\&opti\_ag=0\&opti\_ad=0*.