Google AJSID Segments

📘

This integration is currently in beta. Contact your MetaRouter support team to get started.

What Is Google AJSID Segments?

Google AJSID Segments is an add-on for the Google Ads - Conversions integration that enables the creation of first-party audience lists based on website events such as page views, order completions, blog visits, and more. This integration captures users visiting specified site pages for first-party audience segmentation purposes.

Based on an AUDIENCE_ID, this integration adds operations to the designated offline user data job by incorporating the ajs anonymous ID. When an event, such as an order completion, occurs, it also includes product details related to the transaction. This process is aligned with the Google Ads API, following the guidelines outlined in the official documentation.

What are the benefits of integrating MetaRouter with Google AJSID Segments?

  • Automated Audience Segmentation: This integration automatically builds first-party audience lists in Google Ads based on user interactions with your website (e.g., page views, order completions), reducing the need for manual intervention and improving efficiency.
  • Enhanced User Targeting: By utilizing the ajs anonymous ID and incorporating detailed event data such as product information for order completions, this integration allows for more accurate and personalized ad targeting, boosting campaign effectiveness.
  • Efficient Data Handling: The integration seamlessly processes user data and event details, enabling quick creation of audience segments in Google Ads while ensuring compliance with Google Ads API standards. This streamlines workflows and ensures high-quality data for ad targeting.

Capabilities and Considerations

  • First-Party Audience Creation: Automatically creates first-party audience lists in Google Ads based on user activity on specific web pages (e.g., page views, blog visits, order completions).
  • User Identifier Integration: Leverages the ajs anonymous ID for tracking and associating user activity with Google Ads audience segments.
  • Event-Based Segmentation: Captures and processes a wide range of website events (e.g., order completions) to build detailed audience segments based on user actions.
  • Automated Offline User Data Job Operations: Adds user data and event information (such as AUDIENCE_ID and product details for completed orders) to offline user data jobs in Google Ads.
  • Consent Management: Incorporates user consent for advertising data and personalization, ensuring compliance with consent policies.
  • Product-Level Event Data Capture: For order completion events, captures and sends specific product details, such as product ID, quantity, and transaction information, to Google Ads.

Limitations

  • Single Audience Association: Each starter kit can only be tied to a single audience list ID, which means multiple audience segments require separate configurations.
  • Event-Driven Limitations: Only specific website events (e.g., page views, order completions) are supported for audience creation, potentially limiting the range of segmentation based on more complex user behaviors.
  • Dependency on ajs anonymous ID: The integration relies on the ajs anonymous ID for user identification, which may not support all types of user tracking or identification across platforms.

Getting Started - From Your Google Ads Account

  • Create a Customer List and Capture the Audience ID

    1. In your Google Ads account, select Tools.
    2. Select Audience Manager and click on the “+” sign to add a new Customer List.
    3. Select “Skip this step and set up a data source later”.
    4. Name your segment and click Done.
    5. You can grab the Audience ID needed in the integration in the URL of your data segment page, copy the numeric code following &userListId=
      Screenshot 2024-09-10 at 10.53.18 AM.png
  • Find and capture your AW GTAG ID

    1. In your Google Ads account, select Tools.
    2. Select Audience Manager and click on the Your data sources tab.
    3. Click on Details in your Google Ads tag widget.
    4. Click on Tag Setup and then Install the tag yourself.
    5. Within the tag’s code, you will find gtag('config', 'AW-00000000000');, copy the numeric value following “AW-”.
  • Developer Token

    • Create a Developer Token
      1. In your Google Ads account, select Admin.
      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.


Getting Started - From Your MetaRouter Account

Adding a Google AJSID Segments integration.

From the integration library, add a Google AJSID Segments integration. Then, fill out the Connection Parameters:

Connection ParameterDescription
AUDIENCE_IDThe user list Id of your customer list audience segment.
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.
PRIVATE_KEYPrivate key generated from Google Cloud Platform.
SERVICE_ACCOUNT_EMAILEmail created in Google Cloud Platform, Service Accounts.

Adding a Google Ads Segments Sync

You need to add the Google Ads Segments sync to send the AJS ID to your Google Ads GTAG, allowing you to store users in your audience segment list.

  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 Ads Segments sync.

  3. Fill out the following fields:

    1. Consent Type
    2. Cookie Lifetime (in days)
    3. Conversions - Please paste the following template:
    [{"adsID":"AW-XXXXXXXXXXX","label":"LABEL"}]
    
    • Replace XXXXXXXXXXX with your AW GTAG numeric value as mentioned in the steps above.
    • Please use an arbitrary label such as “LABEL”. If you change the label to “CONVERSIONS” then you may see duplicate conversions in Google Ads.
  4. Scroll down and click the Save and Build File button.

  5. Deploy your AJS file to propagate changes to your web property.


Event Mappings

You can tailor the playbook based on the users you wish to include in your audience segment. The starter kit provides the "Order Completed" event as a reference point.

Event Specific

Order Completed

Output KeyDescriptionExpected Input
order_completedType: Object
The code processes an order_completed event by extracting product details, transaction info, and locale settings. It formats the data, including transaction date, amount, currency, order ID, product ID, quantity, language, and country, into a structured JSON object.
N/A - Expression

Required Identifiers

These identifiers must be mapped to Google AJSID Segments in order for successful user matching to occur.

AttributeExampleSync Injector Required?
ajsid130161d0-8fee-4167-aa4d-d151eed27c6bYes*

*The sync injector is needed to send the AJS ID to the Google Ads GTAG.


Additional Google AJSID Segments Documentation