This article provides guidance on how set up a hybrid model for Google AdWords and Facebook Ads using Tealium iQ Tag Management and AudienceStream to add and remove users from segments.

In this article

Table of Contents Placeholder

How it Works

You can use iQ Tag Management and AudienceStream to set up a hybrid model for Google AdWords and Facebook Ads. This model uses the Google Customer Match Connector and the Facebook Ads Connector to add and remove users from segments without the use of Personally Identifiable Information (PII).

To do this, a Tealium-provided external ID is synced to a Facebook and a Google cookie. Facebook and Google then map this external ID to their own cookie base using AudienceStream server-side connectors, which uses the ID to add and remove users from segments.


  • Tealium iQ Tag Management
  • Tealium AudienceStream
  • Tealium Connectors
    • Google AdWords Customer Match (Customer-Provided Credentials)
    • Facebook Ads
  • To use Customer Match within Google Ads, your site must be whitelisted through your Account Manager.
  • Your account must be active for at least 90 days and have a minimum "total spend" greater than $50,000.

Vendor Documentation

Setup Steps

This section provides guidance on how to set up this hybrid model for your account:

  1. Go to Tealium AudienceStream and set up a string with an enrichment to record the Tealium Visitor ID, as follows:
    Facebook Ads and Google AdWords Attributes.png
    • If available, this step also enriches with the Tealium First Party or Third Party Cookies.
    • If you set the rule to not enrich, once the string is assigned, this value is stored as a Unique ID for the user.
    • The second and third enrichments are:
      tealium_firstparty_visitor_id and tealium_thirdparty_visitor_id
      These are built-in attributes and do not require configuration.

  2. From iQ Tag Management and activate the DLE service for Collect Tag.
    This step is necessary to handle TAPID-related issues that could affect joint Customer Data Hub (CDH) profiles with multiple domains.
    • Use the Set Data Value extension to capture the DLE attribute from Step 1 and set to UDO as_property_v_id.
    • Sample code:
      (function(){return b[""] ? b[""] : b["cp.utag_main_v_id"];}());

      This example uses utag_main_v_id as a fallback for the default DLE behavior with delay. Depending on the use case requirements, consider setting up a polling and callback: Use Case: Creating Next Page Personalization

  3. From iQ Tag Management, create a new variable named external_id and set the same value to it as in Step 2.
    • Use the Crypto Extension on SHA256 to hash external_id.
      Crypto Extension Configuration.png

  4. From iQ Tag Management, adjust the Facebook Pixel to map as_property_v_id to extern_id using a custom destination.
    • It is necessary to do this step using Advanced Matching (am.), as it is sent in pixel initialization.
    • The current Facebook Pixel template (tv:6026.20191204) is built to hash any mapped am. value to SHA256.
      Unhashed Values
      Facebook recommends to hash External ID but it is not required. If you want to send an unhashed value, use the Tealium Generic tag (image option) and use the parameter ud[extern_id].

      Whether you use a hashed or unhashed value, be sure to use the same value in the AudienceStream connector.

  5. From iQ Tag Management, adjust the Google Ads tag to map external_id to user_id.
    • It is necessary to do this step by manually typing the config. prefix using a custom destination because the current templates, both gtag and remarketing, do not provide the default user_id mapping in toolbox.
    • This example uses SHA256-hashed value and is recommended though not required for both client-side and server-side mapping.
      Encryption of as_property_v_id.png
    • If you are using Google Ads Conversion Tracking & Remarketing (gtag.js) from the Tealium Tag Marketplace, you must switch on "Enable Remarketing" within the tag configuration.
    • From Google Ads Manager, check to include User ID parameter within the Google Ads tag data source settings to enable anonymous user matching.
      Include user_id parameter in Google Ads tag.png

  6. From AudienceStream, set up a string attribute External ID to record the hashed version external_id.

  7. From AudienceStream, configure the Facebook Ads connector and map the hashed attribute to External ID.

    The checkbox for ID hash does not apply to External ID in the current build of the connector (as of July 2020), therefore if you leave the box unchecked, the External ID will not be hashed. Tealium uses Crypto Extension to pass the hashed version to Facebook via the AudienceStream connector whereas the Pixel hashes it automatically.

    Facebook Ads Connector Map User Identifier.png
  8. From AudienceStream, configure the Google Ads Customer Match connector and select the hashed attribute as the User ID to align with the mapped value on the client-side tag.

    This approach only works with the Google Remarketing list type CRM_ID.

    Bildschirmfoto 2020-07-06 um 14.35.04.png

Tealium Connectors Used

The following two (2) Tealium connectors are used for this solution.

Google AdWords Customer Match (Customer-Provided Credentials)

Google AdWords Connector.png

Facebook Ads

Facebook Ads Connector.png

Data Flow Chart

The following flow chart depicts the workflow for this task. Click on the image for a larger view.Facebook & Google Ads (External IDs) - Page 1 (2) (1).png


  • Using User ID, what happens if you send a different ID on the same Device/PIxel? Is it overwritten?
    Several user IDs can be managed per Google user. The ID is not overwritten.

  • What is the approach for Mobile Apps?
    If are no Cookies, can the User ID still be sent?
    How is that set up?
    Can Users also be identified on Web?
    If you need an approach to use for mobile device IDs, such Identifier for Advertisers  (IDFA) for iOS or  Google Advertising ID (AAID) for Android, the solution is similar. The collection of IDs and subsequent targeting are naturally limited to the mobile environment and therefore needs to be implemented separately due to the fact that no combination with other matching procedures such as User ID is possible.

  • What is a best practice to use to ensure the Pixel and User ID cannot be synced, such as with Ad Blocker?
    Can you use a Server-Side Click ID?
    Matching using Click IDs is not permitted. One method you could use is to create goal-based audiences using Google Analytics.

  • What is the real-time aspect of User ID?
    How quickly are new users added or removed?

    New users are added or removed within a 24-hour window, though typically does not take the entire 24 hours.