> ## Documentation Index
> Fetch the complete documentation index at: https://docs.segmentstream.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Ads

> Connect Google Ads to SegmentStream and import campaign cost data.

## Getting started

<Steps>
  <Step title="Navigate to Data Sources">
    Inside the admin panel navigate to the **Data Sources** page and click **+ NEW** on the top right corner.
  </Step>

  <Step title="Select Google Ads">
    Choose **Google Ads** from the list.
  </Step>

  <Step title="Authenticate">
    Click **Authenticate with Google** and go through the authentication flow.
  </Step>

  <Step title="Select accounts">
    Select the manager or individual Google Ads advertising accounts you would like to connect.
  </Step>

  <Step title="Save">
    Click **Save**.
  </Step>
</Steps>

## Manager advertising accounts

By default, both [manager](https://support.google.com/google-ads/answer/6139186) and individual advertising accounts are available for data import. If you select a manager account, all associated individual accounts will be automatically connected as well.

## UTM tagging best practices

SegmentStream uses the Google Click ID (GCLID) to link sessions to ad cost data. However, in some cases, the GCLID may be unavailable due to [privacy issues](https://support.google.com/analytics/answer/11367152?hl=en). In such cases, you can link sessions by adding the `utm_source`, `utm_medium`, and `utm_id` parameters to your tracking template.

We suggest using the following format in the Google Ads account-level tracking template:

```plain text theme={null}
{lpurl}?utm_source=google&utm_medium=cpc&utm_id={campaignid}_{adgroupid}_{assetgroupid}_{creative}
```

For instructions on how to edit your tracking template, refer to the [Google Ads documentation](https://support.google.com/google-ads/answer/10070427).

<Warning>
  To ensure proper allocation of costs for your ad extension clicks (such as sitelink extensions, price extensions, promotion extensions, etc.), avoid defining UTM parameters at the Ad or Ad Extension level. Instead, define your UTM parameters at the Account, Campaign, or Ad Group level.
</Warning>

## Supported dynamic URL parameters

By default Google Ads allows the use of [dynamic URL tagging parameters](https://support.google.com/google-ads/answer/6305348) to track campaigns.

SegmentStream supports the following parameters:

| Name                | Description                                                                                                                                                                        |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `{lpurl}`           | The final URL. It will be escaped unless you put `{lpurl}` at the beginning of your tracking template.                                                                             |
| `{gclid}`           | The Google click identifier of a click that comes from your ad.                                                                                                                    |
| `{campaignid}`      | The campaign ID. Use this when you've set up your tracking info at account level and want to know which campaign served your ad.                                                   |
| `{adgroupid}`       | The ad group ID. Use this when you've set up your tracking info at the account or campaign level and want to know which ad group served your ad.                                   |
| `{assetgroupid}`    | The asset group ID. Use this when you want to know which asset group served your ad, for example in Performance Max campaigns.                                                     |
| `{targetid}`        | The ID of the keyword (`kwd`), dynamic search ad (`dsa`) target, remarketing list target (`aud`), product partition (`pla`) or hotel group partition (`hpi`) that triggered an ad. |
| `{creative}`        | A unique ID for your ad.                                                                                                                                                           |
| `{network}`         | Where the click came from: `g` for Google search, `s` for a search partner, or `d` for the Display Network.                                                                        |
| `{keyword}`         | For the Search Network: the keyword from your account that matches the search query. For the Display Network: the keyword from your account that matches the content.              |
| `{loc_interest_ms}` | The ID of the location of interest that helped to trigger the ad. Reported only for campaigns that show ads to people searching for your targeted locations.                       |
| `{loc_physical_ms}` | The ID of the geographical location of the click. Reported only for campaigns that show ads to people in your targeted locations.                                                  |
| `{matchtype}`       | The match type of the keyword that triggered your ad: `e` for exact, `p` for phrase, or `b` for broad.                                                                             |
| `{device}`          | The type of device that the click came from: `m` for mobile (including WAP), `t` for tablet, and `c` for computer.                                                                 |

<Note>
  If you use unsupported parameters in UTM tags, you will see the parameter names instead of their values (for example, `{source}` instead of `search.google.com`). Move unsupported parameters from UTM tags to additional custom GET parameters and collect them to custom dimensions in Google Analytics.
</Note>

## Sharing access with SegmentStream

To help SegmentStream perform quality checks and validate data, you can share view-only access to your Google Ads account. Contact the support team at [support@segmentstream.com](mailto:support@segmentstream.com) with your Google Ads Account ID(s), and a linking request will be sent from the MCC for troubleshooting access.
