Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


This Data Connector is in Beta. For more information, contact


  • Basic knowledge of Amazon DSP and an advertiser account

  • Basic Knowledge of Treasure Data: Authentication, Query, Results Export, and (optionally) Workflow.


  • The External Audience ID is the key to specify the target Audiences on Amazon (it is unique to all audiences). The values of this field will be unique for each Advertiser account.

  • The job may split the result set into multiple batches. In the case of one batch fail, the connector will not revert successfully uploaded batches.

  • The prefixes as required per Amazon DSP API (COOKIE- or MAID-) will be added by the connector. Do not add these prefixes manually in the result set.

  • The connector will not update Audience Metadata.

  • Null or empty column data will be ignored

  • Result output schema must have at least maid or cookie or both cookie and maid column in their metadata

  • maid and cookie column must be in String data type

  • Maximum length for a cookie field is 1999 characters

Use the TD Console to Create Your Connection

Create a New Connection

In Treasure Data, you must create and configure the data connection, to be used during export, 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 HubCatalog.

  3. Search for and select Amazon DSP Data Provider.

  4. The following dialog opens.

  5. Choose the Region of your advertiser account

  6. Enter your Advertiser ID. Then select Continue.

  7. Enter a name for your connection.

  8. Select Done.

Export Results to Amazon DSP

Create or reuse a query. Sometimes you need to define the column mapping in the query.


  1. Open the TD Console.

  2. Navigate to Data Workbench > Queries.

  3. Select the query that you plan to use to export data.
    For example:

    Code Block
    SELECT a_cookie_column AS cookie,
    a_maid_column AS maid
    FROM your_table;
  4. Select Export Results located at top of your query editor. 

  5. The Choose Integration dialog opens.
    You have two options when selecting a connection to use to export the results:

    • using an existing connection

    • creating a new one

Use an Existing Connection

  1. Type the connection name in the search box to filter.

  2. Select your connection.

    Image Modified
  3. Select Next.

  4. Type values for Audience Name, Audience Description, External Audience ID, Time to live, Operation and Ignore Invalid Records.

Create a New Amazon DSP Data Provider Connection

  1. Select Create New Integration.

  2. Type a Name for your connection.

  3. Select your region from Region.

  4. Type your advertiser id in Advertiser ID.

    Image Modified

  5. Select Next.

  6. Type values for Audience Name, Audience Description, External Audience ID, Time to live, Operation and Ignore Invalid Records.

    Image Modified

  7. Select Done.

Use of Scheduled Jobs for Export

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

Configure Export Results in Workflow

Code Block
timezone: UTC

    database: sample_datasets

  td>: queries/sample.sql
  result_connection: your_connections_name
    region: NA
    advertiser_id: 12345
    audience_name: This is a test audience
    audience_description: This is for testing purpose
    external_audience_id: test_audiences
    time_to_live: 3600
    operation: Add
    ignore_error: false