# Google Display And Video 360 API Export Integration Due to Digital Markets Act (DMA) regulations, you must start sending consent signals when uploading Customer Match audience members by **March 2024** to adhere to the **EU User Consent Policy** and continue using European Economic Area (EEA) user data to populate Customer Match audiences. After **March 6, 2024**, Google Ads will no longer accept uploads of Customer Match, conversions, and store sales data for EU users without valid consent. This means that any audiences without consent for EU users will not be processed. The consent setting for non-EU regions will not have any immediate impact on your data upload. However, Google Ads may use this information to improve its targeting and personalization capabilities in the future. Google Display & Video 360 allows you to create certain types of audiences using first-party data, for example, email, phone, name, mobile device ID, etc. (For more information, refer to [DV360 API](https://developers.google.com/display-video/api/guides/audiences/overview)). This Google Display & Video 360 API Export Integration enables you to upload job results from Treasure Data into Google DV360 directly. ## What can you do with this Integration? - Create FirstAndThirdPartyAudience, then upload customer-matching members into DV360 - Update customer matching members from existing FirstAndThirdPartyAudience ## Prerequisites - Basic knowledge of Treasure Data, including the [TD Toolbelt](https://toolbelt.treasuredata.com/). - Google Display & Video 360 account. ## Requirements and Limitations - Query columns must be specified with exact column names (case insensitive) and data type. The static IP address of Treasure Data is the access point and source of the linkage for this Integration. To determine the static IP address, contact your Customer Success representative or technical support. ## Static IP Address of Treasure Data Integration If your security policy requires IP whitelisting, you must add Treasure Data's IP addresses to your allowlist to ensure a successful connection. Please find the complete list of static IP addresses, organized by region, at the following link: [https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/](https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/) ## Use the TD Console to Create a Connection You must create and configure the data connection in Treasure Data before running your query. As part of the data connection, you provide authentication to access the integration. ### Create a New Authentication 1. Open **TD Console**. 2. Navigate to **Integrations Hub** > **Catalog**. 3. Search for Display & Video 360 API and select Display & Video 360 API. ![](/assets/screen-shot-2023-09-14-at-06.52.05.1bb3688bdf68f0f15dc6e5ed21e2b44c8412b97f8b579c8cd955eb57ea89cab1.333733da.png) 4. Select the **Sign in with Google** in the New Authentication dialog to connect to the Google Display & Video 360 account. ![](/assets/image2023-8-29_15-54-32.5d532c01322b9ba8380fa080d139702b974a098196ef2abf96a68eff9d8d045c.333733da.png) 5. You will be redirected to Google to log in using OAuth. Provide the username and password. ![](/assets/google-display-and-video-360-api-export-integration-2024-01-29.8d4c19d8539896b6a6f19e6bd2de6f3f89df8a128c0c391150c1a9350a4c2121.333733da.png) 6. Select **Log In,** and it will redirect back to TD console. 7. Select **Continue**. 8. Type a name for your connection. 9. Select **Done**. ## Specify the Result Export Target 1. Select**Export Results.** ![](/assets/image2021-9-7_15-10-56.ee7ed43caab64adefafcc22595462fd8068c974c4f47b5959a7babd7d99972b8.333733da.png) 2. Select an existing integration authentication. ![](/assets/image2020-12-18_13-44-6.09e8af43184e33e337bef7c546600eaaa5be9f010b690af1d591c7c2b4bb2df3.333733da.png) 3. Define any additional Export Results details. In your export integration content, review the integration parameters. ## Define your Query Your query should include the following: - Required columns - Column data type matching - Other columns will be ignored. Required columns don't accept a null or empty value (else the record is considered invalid and skipped). | **Field Name (Output Schema)** | **Description** | **Data Type** | **Required** | **Support hashed data input (SHA-256)?** | | --- | --- | --- | --- | --- | | email | User email | String | - Include a domain name for all email addresses (for example, gmail.com or Outlook – free personal email and calendar from Microsoft ) | Yes | | phone | User phone number [E.164 format](https://en.wikipedia.org/wiki/E.164) | String | - Format phone numbers using the [E.164 format](https://en.wikipedia.org/wiki/E.164) - Include the country code For example: - 1 (234) 567-8910 - 81-12-3456-7891 - 02 1234 5678 | Yes | | first_name | User first name | String | - Don't include prefixes (e.g.: Mrs.) For example: - john - zoë | Yes | | last_name | User last name | String | - Don't include suffixes (ex: Jr.) For example: - smith - smith-jones | Yes | | country | User country code | String | **Don't hash Country data** - Use ISO two-letter country codes - Include the country code even if all of your customer data is from the same country For example: - US for United States - SG for Singapore | | | zip | User zip code | String | **Don't hash Zip data** - Both US and international zip and postal codes are allowed - For United States: - 5 digit codes are allowed - 5 digits followed by 4-digit extension are also allowed and may improve your match rate - For all other countries: - Leave out postal code extensions For example: - 94303 - 94303-5300 - WC2H 8LG | | | mobile_device_id | Mobile device id | String | **Don't hash Mobile Device ID data** | | | **Matching Type** | **Columns require** | **Example query** | | --- | --- | --- | | Email address matching | email | select email from tbl | | Phone matching | phone | select phone from tbl | | Mailing address matching | first_name, last_name, country, zip | select first_name, last_name, country, zip from tbl | | Combined email address, mailing address, and phone matching | email, phone, first_name, last_name, country, zip | select email, phone, first_name, last_name, country, zip from tbl | | Mobile Device ID matching | mobile_device_id | select mobile_device_id from tbl | ## Integration Parameters for Google Display & Video 360 API ![](/assets/screenshot-2024-08-28-at-12.23.59.c08afbe2f62f317808e86742ca6c67750305651e23f755f5ce80e09f3cbade1c.333733da.png) | Parameter | Required | Description | | --- | --- | --- | | Matching Type | yes | Customer matching data type | | Mode | yes | create: Create Audience update: Update Audience Members | | Advertiser ID | yes | Advertiser ID | | Audience name | yes | Audience name | | Audience description | Optional | Audience description | | Membership Duration Days | yes, if Mode is "Create Audience" | Membership duration lets you decide how long a customer stays on your list. If the audience has no expiration, set the value of this field to 10000. Otherwise, the set value must be greater than 0 and less than or equal to 540. | | Ad user data consent | Optional | Consent status. Support values: - consent_status_granted - consent_status_denied | | Ad personalization consent | Optional | `Consent status. Support values:` - consent_status_granted - consent_status_denied | | Upload Batch Size | Optional | Number of records upload per request. Default 400000 (Minimum: 10000, Maximum: 500000) | If the integration is configured in Create mode and scheduled to run recurrently, the second execution will fail because the target Audience already exists. To avoid this, after the first successful execution, change the setting to Update mode. ### (Optional) Schedule Query Export Jobs You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify. Treasure Data's scheduler feature supports periodic query execution to achieve high availability. When two specifications provide conflicting schedule specifications, the specification requesting to execute more often is followed while the other schedule specification is ignored. For example, if the cron schedule is `'0 0 1 * 1'`, then the 'day of month' specification and 'day of week' are discordant because the former specification requires it to run every first day of each month at midnight (00:00), while the latter specification requires it to run every Monday at midnight (00:00). The latter specification is followed. #### Scheduling your Job Using TD Console 1. Navigate to **Data Workbench > Queries** 2. Create a new query or select an existing query. 3. Next to **Schedule**, select None. ![](/assets/image2021-1-15_17-28-51.f1b242f6ecc7666a0097fdf37edd1682786ec11ef80eff68c66f091bc405c371.0f87d8d4.png) 4. In the drop-down, select one of the following schedule options: ![](/assets/image2021-1-15_17-29-47.45289a1c99256f125f4d887e501e204ed61f02223fde0927af5f425a89ace0c0.0f87d8d4.png) | Drop-down Value | Description | | --- | --- | | Custom cron... | Review [Custom cron... details](#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. | | None | No schedule. | #### Custom cron... Details ![](/assets/image2021-1-15_17-30-23.0f94a8aa5f75ea03e3fec0c25b0640cd59ee48d1804a83701e5f2372deae466c.0f87d8d4.png) | **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 Value | Example | Example 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. | 1. (Optional) You can delay the start time of a query by enabling the Delay execution. ### 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 exported to the specified destination. Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications. (Optional) You can delay the start time of a query by enabling the Delay execution. ## (Optional) Configure Export Results in Workflow Within Treasure Workflow, you can specify the use of this integration to export data. Learn more about [Exporting Data with Parameters](https://docs.treasuredata.com/display/PD/Exporting+Data+with+Parameters). ### Example Workflow for creating contact info matching audience (email matching) ```yaml _export: td: database: dv360_db +dv360_task: td>: dv360.sql database: ${td.database} result_connection: new_dv360_auth result_settings: type: google_dv360 matching_type: "email" mode: "create" advertiser_id: 123 audience_name: "audience_name" audience_description: "audience_description" membership_duration_days: 10000 ad_user_data_consent: "consent_status_granted" ad_personalization_consent: "consent_status_denied" batch_size: 400000 ```