Skip to main content
The Google Ads Connector API lets an unattended integration deliver hashed identifiers from a Narrative dataset into Customer Match user lists in your Google Ads account. A person signs in once to create an API key, and the integration uses that key from then on. Complete the prerequisites and set up API access on this page before you follow any Google Ads API guide. The guides are listed under Guides on the Google Ads Connector reference page.

Prerequisites

API key

Create the key under Settings → API Keys with read and write on datasets and connections, write on uploads, and read on installations, apps, and app_profiles. Add read and write on webhooks if you want delivery notifications. See API Keys for the procedure and the Permissions Reference for what each resource covers. Create it from a shared team account rather than a personal login, so the integration keeps working when someone changes roles. The Google Ads Connector is app 14. Find your installation of it:
To read that installation on its own:
Record the installation ID. If no record has "app_id": 14, install the Google Ads Connector from the Narrative Marketplace. Narrative delivers to Google Ads as a Customer Match partner, so you link your Google Ads account to Narrative I/O once, before you create a profile for it. In Google Ads, open Tools → Data manager, click Narrative I/O, and authorize the link request. See Link your Google Ads account. The customer ID is the ten-digit number at the top of Google Ads. The API takes it as a number without dashes, so 123-456-7890 becomes 1234567890.

Set up API access

The guide talks to two hosts, and each takes its own credential:

Get an installation token

The Google Ads connector authenticates requests with an installation token, which you get by exchanging your API key. Use the installation ID from Google Ads Connector installed:
Store access_token as $INSTALLATION_TOKEN. It lasts about three hours, so request a new one at the start of each run of your integration. Confirm that both hosts answer:
Send the API key to api.narrative.io and the installation token to googleads.narrativeconnectors.com.
API keys contain characters that shells mangle. Read the key from a file or an environment variable rather than pasting it inline.

Find your profile

A profile ties your Narrative company to one Google Ads customer ID, and every connection names the profile it delivers through. GET /profiles lists them all. To read one:
Use a profile whose status is enabled and whose google_ads_customer_id is the account you want to deliver to. Record its id. The Narrative API lists the same profiles by name and status:

Create a profile

Create one profile for each linked Google Ads account. Send the customer ID as a number without dashes:
description is optional. Record the id of the new profile, then enable it:
You can also create the profile in the Narrative UI, under Installed Apps → Google Ads Connector. See Setting Up the Google Ads Connector.

Read the connection settings schemas

Each kind of Google Ads connection has a JSON schema for its quick_settings. The connector serves the schemas without a token, and the Narrative API serves the same content:
The guide uses audience_first_party_new and audience_first_party_existing.

Connection settings

For the quick_settings each connection accepts and how a delivery treats existing and new rows, see API connection settings on the Google Ads Connector reference page.

Delivery notifications

The Google Ads Connector reports each delivery as an app webhook event. Subscribe a webhook to app 14 to receive them:
Keep the secret to verify each delivery. The connector sends these events: Read a subscription with GET /webhooks/{webhook_id}, and stop the notifications with DELETE /webhooks/{webhook_id}. See App subscription for the subscription fields and Verifying deliveries for checking the secret.

Google Ads Connector

Supported identifiers and audience membership duration

Hashing PII

Prepare identifiers for Google Ads

Connector Interfaces

Why a dataset connects to an interface rather than a connector

API Keys

Create and rotate keys for programmatic access