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

# Google Ad Manager 360

> Optimize ad delivery with targeted in-sync audiences

> [!NOTE]
>
> Google Ad Manager 360 is a [premium destination](https://docs.hightouch.com/pricing/ss-pricing.md#premium-destinations) and is only available on [Business tier plans](https://hightouch.com/pricing).

## Supported syncing

| Sync type | Description | Supported sync modes | API reference |
| - | - | - | - |
| [**Any data set**](#syncing-data-sets) | Sync data from a source to an Ad Manager cloud storage bucket as a CSV file | Insert, All | [Upload segment members](https://developers.google.com/ad-manager/api/reference/v202411/SegmentPopulationService) |

The Google Ad Manager 360 (GAM 360) destination allows you to batch upload identifiers to audience segments in bulk by sending your desired segments to an Ad Manager cloud storage bucket. The segments appear as [a CSV file](#example-exported-file), which you can then use in GAM 360.

Hightouch can create the audience segment in Ad Manager for you, or upload identifiers to a segment you created yourself in the Ad Manager console. See [Audience segment](#audience-segment).

The integration supports these sync modes:

* **Insert**: Insert mode creates a CSV file with the rows that were added since the last sync.
* **All**: All mode creates a CSV file with all the rows in the query results, every time the sync runs.

For more information about sync modes, refer to the [sync modes](https://docs.hightouch.com/syncs/types-and-modes.md#sync-modes) docs.

## Before you begin

Before you can use Hightouch to batch upload your identifiers to GAM 360, ensure you've completed these steps, taken from [Google Ad Manager Help](https://support.google.com/admanager/answer/4349785/):

1. Locate and submit your network code. Find your network code in Ad Manager under **Admin → Global settings → Network code**.
2. If you want to upload to a segment you created yourself, create an active first-party audience segment to associate the identifiers with. If you don't want this segment to collect users using your own inventory, select "Publisher Managed" as the Population method. Skip this step if you want Hightouch to [create the segment for you](#audience-segment).
3. [Create a Google Group](https://support.google.com/groups/answer/2464926) that contains all Google Accounts that will have access to upload and view files.

> [!NOTE]
>
> Expect to wait up for 24 hours from the time of segment creation to the time
> when you can perform batch upload. This applies whether you create the segment
> in the Ad Manager console or Hightouch creates it for you.

Once your account manager has completed your setup, you can create the file of identifiers you want to upload.

## Connect to Google

Go to the [**Destinations** overview page](https://app.hightouch.com/destinations?from=docs) and click the **Add destination** button. Select **Google Ad Manager 360** and click **Continue**.

Hightouch supports two authentication methods:

| Method | Description |
| - | - |
| **Service account** | A Google Cloud service account writes identifier files to your Ad Manager cloud storage bucket. Use this method when you create audience segments yourself in the Ad Manager console. |
| **Google account (enables automatic segment creation)** | Adds a Google OAuth connection to the Ad Manager API alongside the service account. Required if you want Hightouch to [create audience segments](#audience-segment) for you. |

Both methods upload files with a service account, so you provide service account credentials either way.

### Service account

Enter your:

* **GCP credentials**: if you need to create a cloud credential, consult [our documentation](https://docs.hightouch.com/security/gcp.md)
* **GCP Project ID**: you can follow [these steps](https://support.google.com/googleapi/answer/7014113?hl=en) to find it
* **GCS Bucket Name**: this be should just be the name of the bucket, not a URL

![Google Ad Manager 360 setup](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-gam360-connect.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=057f7bdd064b9a1f956ab10a3656d398)

### Google account

Click **Log in to Google Ad Manager 360**, sign in with a Google Account, and grant Hightouch access. The account you authorize must have access to your Ad Manager network with permission to manage audience segments.

After you authorize, enter your:

* **GCP credentials**: the service account Hightouch uses to upload identifier files
* **GCP Project ID**
* **GCS Bucket Name**
* **Ad Manager Network Code**: the network Hightouch creates audience segments in. Find it in Ad Manager under **Admin → Global settings**.

### Grant bucket access

For either method, run the `gcloud` command shown under **Grant permissions** to grant Hightouch's service account the [Storage Object Admin](https://cloud.google.com/storage/docs/access-control/iam-roles#standard-roles) role. To run this command, you need to install the [gcloud CLI tool](https://cloud.google.com/sdk/docs/install). Otherwise, if you use [Google Groups](https://groups.google.com/), you can also [assign this role to a group member](https://support.google.com/a/answer/167094) by using the Admin console or Google Groups.

## Sync configuration

Once you've set up your Google Ad Manager 360 destination and have a [model](https://docs.hightouch.com/getting-started/concepts.md#models) to pull data from, you can set up your sync configuration to begin syncing data. Go to the [**Syncs** overview page](https://app.hightouch.com/syncs?from=docs) and click the **Add sync** button to begin. Then, select the relevant model and the Google Ad Manager 360 destination you want to sync to.

### Syncing data sets

#### List of identifiers

The GAM 360 destination supports several different identifier types.

In the first mapping section, select the column corresponding to the list of identifiers you want to batch upload on the left. On the right, select the type of identifiers that are being uploaded to each segment.

![Record matching in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-gam360-identifiers.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=a3fe552778321697aa33aa32bea07c82)

You can find the full list of identifiers in [Google's docs](https://support.google.com/admanager/answer/4349785?hl=en\&sjid=15048174647173915590-NA).

![Sync configuration in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-gam360-identifier-types.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=eb3e79534789068a8b4a9c4c34cc7336)

#### Audience segment

In the **Audience segment** section, choose whether Hightouch creates the audience segment in Ad Manager or uploads identifiers to a segment you created yourself.

##### Create the segment automatically

Turn on **Automatically create the audience segment in Google Ad Manager**. On the first sync run, Hightouch creates a first-party audience segment in your Ad Manager network and uses its ID as the `list_id` in every upload. Later runs reuse that same segment.

This option requires the [**Google account**](#google-account) authentication method and an Ad Manager network code. Hightouch creates the segment through the Ad Manager [`AudienceSegmentService`](https://developers.google.com/ad-manager/api/reference/v202411/AudienceSegmentService).

Hightouch creates the segment with no rule, so it collects no users from your own inventory. Membership comes only from the identifiers Hightouch uploads. This matches selecting "Publisher Managed" as the population method in the Ad Manager console.

Two optional fields control the segment Hightouch creates:

* **Segment name** — Name for the segment in Ad Manager. Defaults to the model name.
* **How long should users remain in the segment?** — Number of days a user stays in the segment after each upload, from 1 to 540. Defaults to 540.

Because Hightouch reuses the same segment for the life of the sync, changing these fields after the first run doesn't rename or reconfigure the segment in Ad Manager.

> [!WARNING]
>
> Ad Manager can take up to 24 hours after a segment is created before it accepts
> uploads. Sync runs during that window fail, and Hightouch retries the rows on a
> later run, so no data is lost. See [the propagation window
> error](#the-google-ad-manager-audience-segment-was-created-recently).

##### Use an existing segment

Leave **Automatically create the audience segment in Google Ad Manager** turned off. Then denote the audience segment IDs with which the identifiers from the previous section should be associated. You can either specify a column from your model to associate each identifier with a different segment, or a static value to associate all identifiers with the same segment. Use the toggle on the right of the field to flip between these two options.

![Sync configuration in the Hightouch UI](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-gam360-audience.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=0705e1d1d1ad136d6142d96e223e38b5)

#### Enter filename

The filename field lets you specify the parent directory and the name of the file you want to use for your results.
You can include timestamp variables in the filename, surrounding each with `{}`.
Hightouch supports these timestamp variables:

* `YYYY`: Represents the full year in four digits.
* `YY`: The last two digits of the year.
* `MM`: Two-digit month format (01-12).
* `DD`: Two-digit day format (01-31).
* `HH`: Two-digit hour format in 24-hour clock (00-23).
* `mm`: Two-digit minute format (00-59).
* `ss`: Two-digit second format (00-59).
* `ms`: Three-digit millisecond format.
* `X`: Unix timestamp in seconds.
* `x`: Unix timestamp in milliseconds.

All dates and times are UTC.

For example, you could enter `upload/{YYYY}-{MM}-{DD}-{HH}-{mm}-result.json` to dynamically include the year, month, date, hour, and minute in each uploaded file. Hightouch would insert each file in the `upload` directory, which would need to already exist in your bucket.

You can also use other [variable values](https://docs.hightouch.com/syncs/mapping-data.md#variable-values) to include sync metadata in the filename:

* `{model.id}`
* `{model.name}`
* `{sync.id}`
* `{sync.run.id}`

> [!NOTE]
>
> If a file already exists at the path you entered at the time of a sync,
> Hightouch overwrites it.

#### Set filename offset

By default, Hightouch uses the timestamp of the sync run to fill in timestamp variables. You can optionally include an offset in seconds. For example, if you want the filename's date to be 24 hours *before* the sync takes place, enter '-86400' (`24 hours * 60 minutes * 60 seconds`).

#### Empty file results

In insert mode, you can select how Hightouch should handle empty results files. Empty result files can occur if your model's query results haven't changed since the last sync.

You can select whether to **skip empty files**. If you skip empty files, it means Hightouch won't export any files if your model's query results haven't changed since your last sync.

## Example exported file

*Example file content for encrypted cookie IDs:*

```
cookie_encrypted,list_id
ScpJKu-yV8je93qkd32MOA,3153490
w2gsrUcwxF-OiJTRmQswQA,3153490
```

*Example file content for raw AdIDs:*

```
cookie_adid,list_id
38400000-8cf0-11bd-b23e-10b96e40000d,3153490
38400001-8cf1-11be-b23f-10b96e40000e,3153490
```

## Tips and troubleshooting

To see the exact API requests and responses from each sync run, use the [live debugger](https://docs.hightouch.com/syncs/debugger.md). To get notified by Slack, PagerDuty, SMS, or email when a sync fails, set up [sync alerts](https://docs.hightouch.com/syncs/alerting.md). If you run into an issue this page doesn't cover, [contact support](#pylon-chat).

> [!NOTE]
>
> For Hightouch platform error codes related to Google Ad Manager 360, see [Error
> codes: Other destinations](https://docs.hightouch.com/developer-tools/error-codes.md#other-destinations).

### Validate your setup

If you let Hightouch create the segment, confirm the segment exists in Ad Manager under **Audiences** after the first sync run. Membership stays at zero until the propagation window elapses and a later run uploads identifiers, so check the member count again the following day.

If you use an existing segment, confirm the `list_id` in the [exported file](#example-exported-file) matches the segment ID in Ad Manager.

## Common errors

### The Google Ad Manager audience segment was created recently

```
The Google Ad Manager audience segment was created recently. Ad Manager can take up to 24 hours before a newly created segment accepts uploads; this sync will complete automatically on its next run after that window.
```

**Cause:** Hightouch created the audience segment less than 25 hours ago, which is Ad Manager's 24-hour propagation window plus a one-hour buffer. Ad Manager ignores uploads to a segment that hasn't finished propagating. Hightouch fails the run rather than upload a file Ad Manager would discard.

**Solution:** No action needed. The rows stay unsynced, and the sync completes on its next scheduled run after the window elapses. Segments you created manually and referenced by list ID are never gated this way.

### Automatic segment creation requires the Google account method

```
Automatic segment creation requires connecting this destination with the Google (OAuth) authentication method.
```

**Cause:** The sync has **Automatically create the audience segment in Google Ad Manager** turned on, but the destination uses the **Service account** method, which has no Ad Manager API credentials.

**Solution:** Reconnect the destination using the [**Google account**](#google-account) method, or turn off automatic creation and [enter a list ID](#use-an-existing-segment) instead.

### An Ad Manager network code is required

```
An Ad Manager network code is required to automatically create audience segments. Add it to the destination settings.
```

**Cause:** The destination is connected with the Google account method, but the **Ad Manager Network Code** field is empty.

**Solution:** Go to your destination settings and enter your network code. Find it in Ad Manager under **Admin → Global settings**.

### A Google Ad Manager list ID is required

```
A Google Ad Manager list ID is required when automatic segment creation is disabled.
```

**Cause:** Automatic segment creation is turned off and the sync has no list ID column or static value.

**Solution:** Edit the sync's **Audience segment** section and either enter a list ID or turn on automatic segment creation.

### Ad Manager API errors

When automatic segment creation fails, Ad Manager's own error appears in the sync logs, for example:

```
AuthenticationError.NETWORK_NOT_FOUND
```

**Cause:** Ad Manager rejected the request to create the segment. `NETWORK_NOT_FOUND` means the network code is wrong or the Google Account you authorized doesn't belong to that network.

**Solution:** Verify the network code in your destination settings, and confirm the authorized Google Account has access to that Ad Manager network with permission to manage audience segments. For other codes, see Ad Manager's [API error reference](https://developers.google.com/ad-manager/api/reference/v202411/AudienceSegmentService.ApiError).
