# Yahoo Japan Ads Export Integration Yahoo! JAPAN Ads supports companies' marketing activities with simple settings, various marketing channels, and flexible expandability. Strategic marketing communication is possible due to the various advertising distribution aspects unique to Yahoo! JAPAN. With this integration, Treasure Data helps you send your user segment to Yahoo! JAPAN Ads by allowing you to create advertising campaigns on Yahoo! JAPAN Ads using a customized list of first-party data from company websites and mission-critical systems related to Yahoo! Japan. With the Treasure Data export, you can engage in the following: - **Direct Targeting**: Create a user segment on TreasureData using your analysis. Then send it to Yahoo! JAPAN Ads and set up a targeted campaign as a CustomList on Yahoo! JAPAN Ads. - **Custom Segment Targeting**: Send user data with its attributions to analyze and create custom segments to Yahoo! JAPAN Ads. Then set up a targeted campaign as a CustomList on Yahoo! JAPAN Ads. In December 2022, Audience List (Custom) was migrated to new Audience Lists. To create a new one working with Treasure Data, use Audience List (Customer Data). See [here](https://ads-promo.yahoo.co.jp/support/release/30368839.md) for details. The diagram describes the flow for Direct Targeting and Custom Segment Targeting.td_global_id ## Prerequisites - Treasure Data account - Yahoo! JAPAN Ads accounts ## Limitations - The connector only supports an upload of 1 GB of compressed records. - The integration uploads files to Yahoo! JAPAN It could fail during importing and matching in Yahoo! JAPAN Hence, customers must check the Yahoo! JAPAN Ads console to verify the valid parameters. ## About Identifying a User With Treasure Data, you have the following ways to identify a user: | Method | Description | Notes | | --- | --- | --- | | td_global_id | A third-party cookie provided by Treasure Data. It allows you to identify users without implementing CookieSync because the td_global_id is not synced on the Yahoo! Japan website from 2023/01. | No longer recommended | | hashed_email | It allows you to identify users without cookies. Hashed emails sent to Yahoo! JAPAN Ads create a user list by matching the same hashed email on Yahoo! JAPAN Ads. | | | IDFA/ADID | It enables you to identify users with IDFA (Identifier for Advertisers) on iOS or ADID (AdvertisingId) on Android instead of using the Cookie. | It is no longer recommended. | ## Exporting to Yahoo! JAPAN Ads ### Create an Audience List in Yahoo! JAPAN Ads 1. Log into [Yahoo! Business Center](https://business.yahoo.co.jp/), select the Tools to the drop-down list in the Display Ads tab, and open the Target Lists page. If you have difficulty navigating the Yahoo! Ads Campaign Management Tool layout, contact the Yahoo! Japan support team. ![](/assets/image-20200529-231627.02a5496a7e65c17ee2384a6e4ad581e15b41ca6bf202e9653af00fbdca6f19c7.658a5540.png) 2. Select the Add Target List drop-down list and choose the Create Custom List option. ![](/assets/image-20200529-231704.4d5e20d0c0e8def12e3625b11293cfafa86233cae801f749b05fd926997fb5db.658a5540.png) 3. Check the Custom Audience ID / Target List ID. ![](/assets/image2022-9-8_6-10-1.9f6aa51908128f42deea95e02feb26f23be9040951dfde2c3784ce8722fd45fb.658a5540.png) 4. If the Audience List-ID column is not shown, select the Display tab and select the Target List ID checkbox. ![](/assets/image-20200529-231928.1d37e2aee3c738525b9fdd326a4eb9fb58fd713c5f0ff0daa7943dcd47f1f517.658a5540.png) ## Get Brand ID on Yahoo! JAPAN Ads for Treasure Integration Contact your Treasure Data Customer Success representative. ## Use the TD Console to Create Your Connection ### Create a New Connection In Treasure Data, you must create and configure the data connection for export before 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 **Yahoo! JAPAN Ads**. 4. The following dialog opens. ![](/assets/screen-shot-2021-04-08-at-14.36.27.bcdec2bc7eb8e63e42e2ca529f7af3ab49ff70ecab26257f5643789c7242d8d6.658a5540.png) 5. Enter your Brand ID. 6. Enter a name for your connection. 7. Select **Done.** ### Define your Query ### Integration Parameters for Yahoo! JAPAN Ads (Direct Targeting) Set the following parameters: | Parameter | Description | | --- | --- | | `user_list_type` (required) | User list type:- `direct_targeting` - `custom_segment_targeting` | | `user_id_type` (required) | User ID type:- cookie - email: the first column, uid, is an email or hashed email SHA256 - If the result of your hashing is in uppercase, please convert it to lowercase - IDFA: the first column, uid, is a UUID - AAID: the first column, uid, is a UUID | | `ignore_invalid_records` (optional) | Ignore the invalid records. | | `custom_audience_id` (optional) | A custom audience id (site retargeting id) is required when `user_list_type` is `direct_targeting. See here to retrieve the ID.` | | account_id (optional) | Account Id is needed when `user_list_type` is `direct_targeting` | | `target_list_id` (optional) | An audience list id is required when `user_list_type` is `direct_targeting.` | Here is a sample configuration: ``` type: yahoo_dmp brand_id: brand_id user_list_type: direct_targeting user_id_type: hashed_email custom_audience_id: custom_audience_id account_id: account_id target_list_id: target_list_id ignore_invalid_records: false ``` ### Integration Parameters for Yahoo! JAPAN Ads (Segment Targeting) Set the following parameters: | Parameter | Description | | --- | --- | | `user_list_type` (required) | User list type:- `direct_targeting` - `custom_segment_targeting` | | `user_id_type` (required) | User ID type:- cookie - hashed_email: the first column, uid, is an email or hashed email SHA256 - If the content of the column is not hashed, it will be hashed automatically - If the result of your hashing is in uppercase, please convert it to lowercase - IDFA: the first column, uid, is a UUID - AAID: the first column, uid, is a UUID | | `ignore_invalid_records` (optional) | Ignore the invalid records. | | `client_id` (optional) | The client id is required when `user_list_type` is `custom_segment_targeting` | | `data_source_number` (optional) | Data source number required when `user_list_type` is `custom_segment_targeting` | Here is a sample configuration: ``` type: yahoo_dmp brand_id: brand_id user_list_type: custom_segment_targeting  user_id_type: hashed_email client_id: client_id data_source_number: data_source_number ignore_invalid_records: false ``` Example Query for Yahoo! JAPAN Ads For `direct_targeting`, Treasure Data supports one column with the format string or number. For example: ```sql SELECT 'my@email.com' as uid; ``` For `custom_segment_targeting`, the first column is the `UID` and has a string or number format. ```sql SELECT 'my@email.com' as uid, '012345' as sms, '123' as sid, 'My Name' as name, 'Mar 11' as dob; ``` Or, write an SQL query to extract user data with attributes to analyze and create custom segments on Yahoo! JAPAN Ads. The User ID must be the first column. For example, remove td_global_id with attributes: ```sql SELECT td_global_id AS td_global_id, MAX(td_os) AS type, COUNT(td_global_id) AS price FROM demo_pageviews GROUP BY td_global_id ``` Or, for the raw email, you can send it as is or hash it by SQL before sending those to Yahoo! JAPAN Ads. The data is compressed by gzip when sent to Yahoo! JAPAN Ads. If the compressed data exceeds 1GB, you must split it before sending it. ```sql SELECT LOWER(TO_HEX(SHA256(TO_UTF8(email)))) FROM demo_email ``` ### (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. ## Activate a Segment in Audience Studio You can also send segment data to the target platform by creating an activation in the Audience Studio. 1. Navigate to **Audience Studio**. 2. Select a parent segment. 3. Open the target segment, right-mouse click, and then select **Create Activation.** 4. In the **Details** panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters. 5. Customize the activation output in the **Output Mapping** panel. ![](/assets/ouput.b2c7f1d909c4f98ed10f5300df858a4b19f71a3b0834df952f5fb24018a5ea78.8ebdf569.png) - Attribute Columns - Select **Export All Columns** to export all columns without making any changes. - Select **+ Add Columns** to add specific columns for the export. The Output Column Name pre-populates with the same Source column name. You can update the Output Column Name. Continue to select **+ Add Columns**to add new columns for your activation output. - String Builder - **+ Add string** to create strings for export. Select from the following values: - String: Choose any value; use text to create a custom value. - Timestamp: The date and time of the export. - Segment Id: The segment ID number. - Segment Name: The segment name. - Audience Id: The parent segment number. 1. Set a **Schedule**. ![](/assets/snippet-output-connector-on-audience-studio-2024-08-28.a99525173709da1eb537f839019fa7876ffae95045154c8f2941b030022f792c.8ebdf569.png) - Select the values to define your schedule and optionally include email notifications. 1. Select **Create**. If you need to create an activation for a batch journey, review [Creating a Batch Journey Activation](/products/customer-data-platform/journey-orchestration/batch/creating-a-batch-journey-activation). ## Optionally Configure Export Results in Workflow You can specify using this data connector to export data within Treasure Workflow. Learn more at [Exporting Data with Parameters](https://docs.treasuredata.com/smart/project-product-documentation/exporting-data-with-parameters). ### Extract the User List to Send to Yahoo! JAPAN Ads 1. Using your preferred text editor or the Treasure Data Workflow editor, open your Yahoo! JAPAN Ads workflow file. 2. Write a SQL query to extract the user list you want to send to Yahoo! JAPAN Ads. See [Creating and Deleting Files](https://docs.treasuredata.com/smart/project-product-documentation/creating-and-deleting-files). ### Run the Workflow to Send the User List to Yahoo! JAPAN Ads If you have just created a new custom target list for Yahoo! JAPAN Ads, wait approximately an hour to run the workflow because it can take time for the latest list to be processed. 1. Open **TD Console**. 2. Navigate to **Data Workbench** > **Workflows**. 3. Highlight your Yahoo! JAPAN Ads workflow. 4. Select the **New Run** button or define a [schedule that runs the workflow repeatedly](https://docs.treasuredata.com/articles/project-product-documentation/scheduling+a+Workflow+from+within+the+Workflow+Definition). 5. Review your workflow results to make sure they were successful. 6. Validate that the `Reach` number is correct after processing the workflow (typically takes 3 - 4 hours). ![](/assets/image-20200529-232807.6a9ea04ecf46008b45a64a6a6844b1fbe131f229dd96f3febc63f81bd8b39ebc.658a5540.png) ### Validate the Processing Status on Yahoo! JAPAN Ads If the Reach number remains at zero and is not updated after the 3-4 hour processing period, you can check the processing status in Yahoo! JAPAN Ads to validate its status. 1. Validate the `GUID` value in the Workflow log for exporting to Yahoo! JAPAN Ads API. ![](/assets/image-20200529-232933.71c0d2b17ff95c79c089e8e42ca24abc34033a9f75ff0607aa808a0fd090a231.658a5540.png) 2. Use an HTTP GET inquiry for the Yahoo! JAPAN Ads API. For example: ```bash $ curl --location \ --request GET 'https://api.tgm.yahoo-net.jp/v3/userlists/guid_value' \ --header 'x-api-key: x-api-key' ``` ```json { "guid": "guid_value", "brandGuid": "brandguid_value", "vendorGuid": "vendorGuid_value", "entityId": "entityId_value", "uidKey": "uidKey_value", "tagDefinitionGuid": "yahoo_japan_ydn_custom_audience_server", "tagFields": { "p": "p_value", "lid": "lid_value" }, "status": "CREATED" } ``` 1. Replace the empty values with the relevant information. | **Field** | **Description** | | --- | --- | | `guid_value` | GUID from workflow | | `x-api-key` | an x-API-key string that you used to set the workflow secrets. (Please get in touch with TD for the API key) | | `brandguid_value` | | | `vendorGuid_value` | | | `entityId_value` | | | `uidKey_value` | | | `p_value` | | | `lid_value` | | If you receive `"status":"ACTIVATED"` as an HTTP result, the process has been completed in Yahoo! JAPAN Ads successfully. If the status is "CREATED," "UPLOADED," or "PROCESSING," the process in Yahoo! JAPAN Ads is not yet complete.