There are several Google Ads integrations available. This article describes Google Ads Remarketing.


This article does not describe Google Ads via Audience Partner API (formerly known as AdWords via DDP). The name changed after Google rebranded Google AdWords to Google Ads.

This integration works on only one specific type of Audience List: Customer list. Other Remarketing List types, such as App User or Website Visitors, are not supported by this integration.


You can export user profiles, such as email or phone numbers, directly into Google Ads Remarketing user list by leveraging this integration. Execute your TD SQL query job results to upload CRM data in bulk, and append or remove data to a Google Remarketing user list.

You can export the data for the userId column. And you can remove users from existing segments.


Prerequisites

  • Basic knowledge of Treasure Data, including the TD Toolbelt.

  • A Google Ads Account.

  • Authorized Treasure Data Google OAuth app access to your own Google Ads Account.

Limitations

The following limitations are described in the Google Ads API document "Remarketing and Audience Targeting" and the Support articles.

  • Minimum of 5000 users. Advertisements are served to user lists that have at least 5000 users. See the section "Customer Match Limitations." The document states: "Upload at least 5,000 members to the list to ensure that ads start serving."

  • Google Account email. An email must be connected using Google Account. See the section "Customer Match with email address, address, or user ID."

  • Non-@gmail.com addresses ignored. Only emails with the form @gmail.com can be used for targeting in Gmail. See the section "Customer Match with email address, address, or user ID."

  • User list rounding. On the Google Ads manager site, the number of user list is not precisely displayed:

    • It is rounded to a hundred if the number of users is less than 1000.

    • Is rounded to the 2 most significant digits otherwise. See the section "Customer Match Limitations."

  • Google Display Network customer match. Customer match is not available for third-party sites within Google Display Network. See the section "Customer Match with email address, address, or user ID."

  • 48-hour delay. It takes up to 48 hours for Google to populate new users to the list. See the section "Note" from https://support.google.com/google-ads/answer/7474263.

Column Naming

Output results must use predefined column names. Supported column names are:

  • mobile_id: IDFA (Identifier for Advertising) or AAID (Google Advertising ID) mobile device IDs. Example: AEBE52E7-03EE-455A-B3C4-E57283966239 (the format is: 8-4-4-4-12 hex characters)

  • email: Email addresses

  • phone_number: Phone numbers

  • user_id: Advertiser generated and assigned user ID. To use this feature, you need to be a whitelisted Google account (for more information: https://support.google.com/adspolicy/answer/6299717). 

If no supporting columns are found from the query result, you receive an error. The column alias is case-insensitive, for example, you can use email or EMAIL.

You have to use aliases in your query if column names don't match supported values. For example:

SELECT an_email_column AS email,
another_phone_column AS phone_number
FROM your_table;

Data Normalization and Hashing

Treasure Data's result output normalizes and hashes your values automatically to follow Google’s formatting and privacy guidelines. The only hashing algorithm supported is SHA-256.

CRM data must follow specific formatting guidelines to be accepted. Incorrect formatting can lead to an upload error or a low number of matched records.

The following conversion behavior is applied, according to data type, during result output for normalization.

  • Mobile Advertising ID: no normalization.

  • Email:

    • If data is plain text, trim leading, and trailing whitespaces, convert all characters to lowercase, then hash before sending

    • If data is already hashed, apply no conversion

  • Phone Number: use the E.164 format, for example, +1234567890

    • If data is plain text, hash the value

    • If data is already hashed, apply no conversion

  • User ID: no normalization.

Google Ads Policies

Treasure Data encourages you to adhere to Google Ads policies, in particular:


Obtain the Google Ads Developer Token

This information requires an Ads Manager account:

  1. Visit the Ad Manager account homepage and select Start now.

  2. Supply required information and select Save to continue.

  3. After your email is verified, your new manager account is active.

  4. Select the Tools, billing, and settings icon and select AdWords API Center under Setup. You only see the AdWords API Center link if you're signed in to a manager account.


  1. You are prompted to accept the terms and conditions of Ads API. Select Create Token after accepting.

  2. You can start using Developer Tokens against test accounts immediately, but Developer Tokens need to be approved to work on real Ads accounts. To do this, you need to apply for Basic/Standard access level.


Use TD Console

Create a New Connection

In Treasure Data, you must create and configure the data connection prior to running your query. As part of the data connection, you provide authentication to access the integration.

1. Open TD Console.
2. Navigate to Integrations Hub Catalog.
3. Search for and select Google Ads.

4. Select Create Authentication

5. Type the credentials to authenticate.
6.  Optionally, select Click here and log in to Google.  

    1. Return Integrations Hub Catalog.
    2. Search for and select Google Ads.
    3. Select New Authentication.
    4. Review the OAuth connection field definition. 
7. Select Continue
8. Type a name for your connection.
9. Select Done.



Define your Query

Output results must use predefined column names. 

You must query the user_id column to upload the user_id to Google.

Treasure Data's result output normalizes and hashes your values automatically to follow Google’s formatting and privacy guidelines. The only hashing algorithm supported is SHA-256.


  1. Complete the instructions in Creating a Destination Integration.
  2. Navigate to Data Workbench > Queries.

  3. Select a query for which you would like to export data.

  4. Run the query to validate the result set.

  5. Select Export Results.

  6. Select an existing integration authentication.
  7. Define any additional Export Results details. In your export integration content review the integration parameters.
    For example, your Export Results screen might be different, or you might not have additional details to fill out:
  8. Select Done.

  9. Run your query.

  10. Validate that your data moved to the destination you specified.


Integration Parameters for Google Ads Remarketing Lists

ParameterRequiredDescription
Ads Account yes

Your Ads Customer ID, the format is: xxx-yyy-zzzz

Mobile Application ID

Your mobile application ID. Required when you export Mobile Advertising ID

UserList nameyesName for the user list.
UserList description
Description of the user list.
Mode

The output mode.

    • Append (default): Query results are appended to an existing user list, or a new user list is created, if none exists by the specified input name.

    • Replace: All members of an existing user list are removed and replaced by query results. A new user list is created, if none exists.

    • Remove: Query results will be removed from an existing user list.
Membership Lifespan
The number of days users' contact info stays on the user list. Default: 10000.
Upload Batch Size

The number of records to upload in each batch. Default: 100000

Retry Limit

The number of retries before the system gives up. Default: 5.

Initial retry time wait in millis

The time, in milliseconds, between the first and second attempt. Default: 500, which is equivalent to 0.5 seconds.

Max retry wait in millis
The time, in milliseconds, between the second and all subsequent attempts. Default: 300000, which is equivalent to 5 minutes.

Example Query

From TD Console, Queries page, run a query similar to the following with output results specified to go into the Google Ads connection. The query is an example only.

SELECT email, phone_number FROM (
  VALUES ('demo1@example.com', '+1234567890'),
         ('demo2@example.com', '+9876543210'),
         ('demo3@example.com', '+9988776655')
)  tbl (email, phone_number)

The query does not require that you specify a source table, you must choose a database.


SELECT email FROM app_users


Your query can include:

  • Only mobile_id

  • Only email and/or phone_number

  • Only user_id
  • All other columns are ignored

The query should complete in a few seconds.


Optionally Validate your Query Results


Validate your Audience List to view the newly populated data:

Optionally Schedule the Query Export Jobs

You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.



1. Navigate to Data Workbench > Queries.
2. Create a new query or select an existing query.
3. Next to Schedule, select None.

4. In the drop-down, select one of the following schedule options.

Drop-down ValueDescription
Custom cron...

Review Custom cron... details.

@daily (midnight)Run once a day at midnight (00:00 am) in the specified time zone.
@hourly (:00)Run every hour at 00 minutes.
NoneNo schedule.

Custom cron... Details

Cron Value

Description

0 * * * *

Run once an hour

0 0 * * *

Run once a day at midnight

0 0 1 * *

Run once a month at midnight on the morning of the first day of the month

""

Create a job that has no scheduled run time.

 *    *    *    *    *
 -    -    -    -    -
 |    |    |    |    |
 |    |    |    |    +----- day of week (0 - 6) (Sunday=0)
 |    |    |    +---------- month (1 - 12)
 |    |    +--------------- day of month (1 - 31)
 |    +-------------------- hour (0 - 23)
 +------------------------- min (0 - 59)

The following named entries can be used:

  • Day of Week: sun, mon, tue, wed, thu, fri, sat

  • Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec

A single space is required between each field. The values for each field can be composed of:

Field ValueExampleExample Description

a single value, within the limits displayed above for each field.



a wildcard ‘*’ to indicate no restriction based on the field. 

‘0 0 1 * *’ configures the schedule to run at midnight (00:00) on the first day of each month.
a range ‘2-5’, indicating the range of accepted values for the field.‘0 0 1-10 * *’ configures the schedule to run at midnight (00:00) on the first 10 days of each month.
a list of comma-separated values ‘2,3,4,5’, indicating the list of accepted values for the field.

0 0 1,11,21 * *’


configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month.
a periodicity indicator ‘*/5’ to express how often based on the field’s valid range of values a schedule is allowed to run.

‘30 */2 1 * *’


configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. ‘0 0 */5 * *’ configures the schedule to run at midnight (00:00) every 5 days starting on the 5th of each month.
a comma-separated list of any of the above except the ‘*’ wildcard is also supported ‘2,*/5,8-10’‘0 0 5,*/10,25 * *’configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month.
5.  (Optional) If you enabled the Delay execution, you can delay the start time of a query.

Execute the Query

Save the query with a name and run, or just run the query. Upon successful completion of the query, the query result is automatically imported to the specified container destination.


Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications.



Optionally Configure Export Results in Workflow

Within Treasure Workflow, you can specify the use of this data connector to export data.

Learn more at Using Workflows to Export Data with the TD Toolbelt.


Troubleshooting 

Q: After one or two days of having the status of 'Populating', my user lists status changes to 'Error with the last upload'. Why is that?

  • During our tests, it seems that Google API has this issue when you upload many lists at the same time. The number of user lists that can cause an issue is unknown, but you should limit your uploads to 3 to 5 user lists at a time.

Q: Why does the value of Size for my user lists keep changing?

  • According to our observation, the size of each network might change daily, based on the number of active users:


Q: Why do my lists have the status: 'Populating...'?

  • It takes 6 to 12 hours for a list to be populated with members, so you'll most likely see a "Populating..." status on the Ads UI if you upload to an audience list more frequently than once every 12 hours. In most cases, it can take up to 48 hours until the list becomes finalized.



  • No labels