Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Deleted duplicated part

You can write job results directly to your Twitter Tailored Audience.

This topic includes:

Table of Contents


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

  • A Twitter Ads Account or an account with Ads Manager role.

  • Authorized Treasure Data Twitter app access to your Twitter Ads Account

Create a New Connection

Go to Treasure Data Connections. Search From TD Console, navigate to the catalog in the Integrations Hub. Search for and select Twitter Tailored Audience.

Image RemovedImage Added

Select Create Authentication. The following dialog opens.

Image RemovedImage Added

Select an existing OAuth connection for Twitter, or select the link under OAuth connection to create a new one.

Image Modified

Create a New OAuth Connection


You will be redirected back to Treasure Data Connections. Repeat the first step (Create a new connection) and choose your new OAuth connection.

Image Modified

You can give a name to your newly created connection and save it for later use.

Image Modified

Configure Output Results


  • Twitter Ad Account ID (required): This is your Twitter Ad Account ID. See Appendix C for getting account id.

  • Tailored Audience Name (required): Name of Tailored Audience list to create.

    • Important note: If you have many Tailored Audience lists with similar names as this input, the latest Tailored Audience Name will be used. We recommend that you give your Tailored Audience list a unique name.

    • Important note: You cannot use audience names that are associated with deleted audiences. When creating a new audience, you will receive an error message if you attempt to reuse a name that is associated with a deleted audience.
  • Audience type  (require): Type of entry in the list. It is one of email, id, device id, or handle.

  • No need to normalize and hash records (default false): Indicates whether the data has already been normalized and hashed. If not, TD automatically normalizes and hashes the records.

  • Skip on invalid records (default false): Indicates whether invalid records should be ignored.
  • Mode (Default Update):Operation type being performed (Update or Delete)
  • Retry limit (optional, default 6): Number of retries before it gives up.

  • Initial intervals in milliseconds between retries (optional, default 10000): Interval to retry if a recoverable error happens (in millisecond).

  • Maximum intervals in milliseconds between retries (optional, default to 32000) : Maximum time in milliseconds between retrying attempts.Skip on Invalid Records? Ignore invalid records/errors and continue loading other records

Here is a sample configuration:

Image RemovedImage Added

Write the Query to Populate a Tailored Audience List


The conversion below is actually applied per type in our result output for normalization.

  • Email Addresses : Lowercase, remove leading and trailing spaces; ex:

  • Twitter User Name : No @, lowercased and leading and trailing spaces trimmed; ex: jack

  • Twitter User IDs : Standard integer; ex: 143567

  • Device IDs : Lower-cased with dashes (IDFA), original format on device, not capitalized with dashes (AdID) and original format on device, not capitalized without dashes or spaces (Android ID); ex: 4b61639e-47cc-4056-a16a-c8217e02946 and af3802a465767e36