Google Ads

What is Google Ads?

Google Ads is an online advertising platform that enables businesses to display ads on Google's search engine results pages and its network of partner websites and platforms. Advertisers can target their ads based on keywords, demographics, interests, and behaviors. It provides a powerful means for businesses to reach their target audience, drive traffic to their websites, and promote their products or services effectively.

What are the benefits of integrating MetaRouter with Google Ads?

  • Streamline, standardize, and control customer data before reaching Google Ads.
  • Decrease the presence of Google tags on your website to enhance SEO performance and overall website experience.
  • Improve SEO performance and website experience while reducing the footprint of Google tags on your website.

Google Ads - Notes and Limitations

  • This integration is used for tracking click-through conversions only. It does not include the Google Ads Customer Match feature or track view-through conversions.
  • This integration uses offline conversions only. New offline conversions must be created in Google Ads and linked to your events in MetaRouter. More information on this process is included below.

Getting Started - From Your Google Ads Account

Ensure Auto Tagging is Enabled

Auto-tagging will attach the “Google Click Identifier” (gclid) parameter to the URL your customers click. The gclid is needed for user identification within the integration. Auto-tagging is turned on by default for new accounts. You can check whether auto-tagging is on by going to your account settings:

  1. In your Google Ads account, click Admin on the left page menu.
  2. Select Account settings from the options available.
  3. Under the “Account settings” menu, select the Auto-tagging drop-down.
  4. Confirm if the box next to “Tag the URL that people click through from my ad” is checked. If the box is checked, auto-tagging is on.

Find Your Customer ID

Finding Customer ID

Set Up Authentication

  • Developer Token

    • Create a Developer Token
      1. In your Google Ads account, select the Tool and Setting section in the top right corner.
      2. Under Setup, select API Center, which will create the required developer token.
      3. After the test API has been created, click the access level.
      4. Apply for Basic Access.
        • This step can take up to three days.
      5. Save the token to use within the connection parameters as the DEVELOPER_TOKEN.
  • Create OAuth Flow

    • Create service account

      1. Go to Google Cloud console.

      2. Click on Service Accounts.

        GC Service Accounts
      3. Click Create Service Account.

        Create Service Account
      4. Fill out service account details.

      5. Press the Create and continue button.

      6. Select role for service account. We recommend minimal access with a role such as “IAM OAuth Client Viewer”. You may skip user access portion.

        Select a Role
      7. Hit done to create service account.

      8. Under the “Email” column, you will use the email listed within the connection parameters as the SERVICE_ACCOUNT_EMAIL.

    • Create a Private Key

      1. Continuing within the Google Cloud console, Service Accounts window, look for the service account you created and click on the 3-dot menu under the “Actions” column.

      2. Click Manage Keys.

      3. Click Add Key.

        Add Key
      4. Click Create New Key.

      5. Select “JSON” as the key type and click Create. A file will save to your device.

      6. Use the save key in the connection parameters as the PRIVATE_KEY.

    • Perform Google Workspace domain-wide delegations of authority

      1. Go to Admin Console.

      2. Go to Security > API Controls > Domain-wide Delegation > Manage Domain Wide Delegation.

        Domain wide delegation
      3. Click Add new.

      4. In the Client ID field, enter the client ID obtained from the service account creation steps above.

        1. Click on your service account email in Google Cloud console
        2. Click on Advanced settings and you will find your Client ID
      5. In the ”OAuth Scopes” field, enter a comma-delimited list of the scopes required for your application.

        1. Add the following for Google Ads: https://www.googleapis.com/auth/adwords

          Scope auth
      6. Click Authorize.


Create Offline Conversion Events

You will need to use offline conversion events and gather their IDs to assign to your event. Please consult the guide below for creating offline conversion events and acquiring event IDs.

  1. Under Tools & Settings, click on Conversions.

    Screenshot 2024-04-15 at 3.32.48 PM.png
  2. On the Conversions page, click on New conversion action button.

  3. Select Import.

    Screenshot 2023-11-08 at 12.05.59 PM.png
  4. Select Manual import using API or uploads and be sure to select Track conversions from clicks.

    Screenshot 2023-11-08 at 12.06.10 PM.png
  5. Input settings for your conversion.

  6. Your conversion should appear on your Summary list of conversions with the conversion source being “Website (import from clicks)”.

    Screenshot 2023-11-08 at 12.06.57 PM.png
  7. The conversion action ID can be found by clicking on the conversion, navigating to the URL, and using the numeric code following ctId=

    Screenshot 2023-11-08 at 12.07.10 PM.png
  8. Instructions on linking your offline conversion event IDs to your MetaRouter playbook are included here.


Getting Started - From Your MetaRouter Account

Adding a Google Ads integration

From the integration library, add a Google Ads integration. Then, fill out the Connection Parameters. Guides on how to find IDs, keys, and tokens and how to create account permissions can be found in Getting Started - From Google Ads section above.


Connection ParameterDescription
API_VERSIONThis will be v16.
CUSTOMER_IDIdentifies your Google Ads account.
DEVELOPER_TOKENDeveloper token obtained from Google Ads, API Center.
PRINCIPAL_EMAILThe email you use to log in to Google Ads and the email that created the service account.
SERVICE_ACCOUNT_EMAILEmail created in Google Cloud Platform, Service Accounts.
PRIVATE_KEYPrivate key generated from Google Cloud Platform.

Adding a Google Gtag Sync

To gather the gclid (Google click ID) value, you must add a Google Gtag sync.

  1. From the Pipelines page, find the pipeline associated with the web property you’d like to add a sync to. Hover over the three-dot dropdown and select “Build AJS File.”
  2. In the Identity Syncs section, select the Google Gtag sync.
  3. Fill out the following fields:
    1. GTAG.js Tag ID - You can find more information on GTAG.js Tag ID here.
    2. Destination IDs - Allows the sync to connect and direct events to the correct Google product. For Google Ads, the destination ID is the same as the conversion tracking ID, for example, AW-98765.
    3. Floodlight Advertiser ID Object - The Floodlight Advertiser ID. This is not required for the Google Ads integration, but it is used for other Google integrations such as Campaign Manager.
    4. Cookie Lifetime (in days) - 45 days default
    5. Fire on Re-sync - Re-syncs for an updated identifier when an Identify call is made.
    6. Send MetaRouterSync to GA4 - Sends a MetaRouterSync event to GA4 when the sync is loaded on the page.
    7. Enable Google Consent Mode - If enabled, consent categories 'ad _storage, 'ad_user_data', 'ad _personalization', 'analytics_storage' will be sent to Google when user is opt-in or opt -out
    8. Advanced Consent Mode Type (when consent mode is enabled) - If consent mode is enabled, the consent mode will be set to advanced' when this is on, and 'basic' when this is off
  4. Scroll down and click the Save and Build File button.
  5. Deploy your AJS file to propagate changes to your web property.

Add Integration to Pipeline

Once you’ve adjusted the starter kit, please go to Pipelines > Select your Pipeline > Right drop-down > Add Integration > Select your Google Ads integration and revision > Deploy.


Event Mappings

MetaRouter provides all of the event mappings that Google Ads integrations typically require. You may add custom events, parameters, or mappings following Google Ads’ API documentation.

Global

Global mappings will be applied to all events.

Output KeyDescription
gclid
Required
Type: String
The Google click ID (gclid) associated with this conversion.
conversionDateTime
Required
Type: String
The date time at which the conversion occurred. Must be after the click time. The timezone must be specified. The format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".

Must send the timezone offset. We use the context.providers.googleGtag.data.timezone_offset value from the Gtag sync.

Event Specific

The page and order_completed events listed below are included in the default playbook.

page

Output KeyDescriptionExpected Input
conversionAction
Required
Type: String
The conversion action must have a type of UPLOAD_CLICKS, and must exist in the Google Ads conversion customer of the Google Ads account associated with the click. Assign your offline conversion action ID here.
N/A - Expression
conversionValue
Required
Type: Double
The value of the conversion.
N/A - Enrichment

order_completed

Output KeyDescriptionExpected Input
conversionAction
Required
Type: String
The conversion action must have a type of UPLOAD_CLICKS, and must exist in the Google Ads conversion customer of the Google Ads account associated with the click. Assign your offline conversion action ID here.
N/A - Expression
conversionValue
Required
Type: Double
The value of the conversion.
N/A - Enrichment
currencyCode
Required
Type: String
The currency code of the conversion_value
properties.currency
orderId
Optional
Type: String
The order ID associated with the conversion. An order id can only be used for one conversion per conversion action.
properties.order_id
cartData.items
Optional
Type: CartData
The cart data associated with this conversion.
product_id
quantity
unit_price
N/A - Expression

Mapping Conversion IDs to Events

You must map your offline conversion event ID to each event. Refer below for mapping instructions:

  1. Open Event in the playbook.
  2. Select an event such as “page”.
  3. Expand conversionAction parameter.
  4. In the return line, replace ADD_CONVERSION_ACTION_ID_HERE with the corresponding offline conversion event ID. Steps to create offline conversion events in Google Ads and collecting the ID can be found here.

Required Identifiers

These identifiers must be mapped to Google Ads for successful user matching to occur. Without these IDs, any events sent to Google Ads will be rejected. For your convenience, required IDs are mapped as Global parameters to ensure they are added to every event.

AttributeExampleSync Injector Required?
gclid
Required
&gclid=CjwKCAjwt-OwBhBnEiwAgwzrUkyNMRwtorgWNStUyWMG50WbzKNMWAFeWOHtq5q0cEbAHYKX7a4hNBoCwugQAvD_BwEYes
conversionDateTime RequiredThe format is "yyyy-mm-dd hh:mm:ss+|-hh:mm", for example, "2019-01-01 12:32:45-08:00".No

Google Ads Documentation