Versions Compared

Key

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

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

Twitter Custom Audiences allow you to leverage your off-platform customer information enabling you to create unique audience segments used for targeting, exclusion, and lookalike expansion.

This topic includes:

Table of Contents
maxLevel1

Prerequisites

  • Basic knowledge of Arm Treasure Data, including the toolbelt.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

...

Go to Treasure Data Connections. Search and select Twitter Tailored Audience.

...

New Connection

Numbered Headings
start-numbering-with1
start-numbering-ath5
From TD Console, navigate to the catalog in the Integrations Hub. Search for and select Twitter Custom Audience.

Image Added

Select Create Authentication. The following dialog opens.

...

Image Added

Select an existing OAuth connection for Twitter, or

...

select the link under OAuth connection to create a new one.

...

Image Added

Create a

...

New OAuth Connection

Numbered Headings
start-numbering-with1
start-numbering-ath5
Log into your Twitter account in the browser (if you haven’t logged in previously) and grant access:

Image Modified

Or grant access to the Treasure Data app when you are already logged in.

Image Modified

...

After you're redirected back

...

to Treasure Data Connections

...

, repeat the first step (Create a new connection) and choose your new OAuth connection.

...

Image Added

Name your newly created connection and save it for later use.

...

Image Added
Configure

...

Output Results
The Output result needs to follow the Twitter Custom List data specifications here. We support single column, single type.
  • TWITTER_ID: Twitter user IDs

  • DEVICE_ID: IDFA, AdID or Android ID of Twitter users

  • EMAIL: Email addresses

  • TWITTER_HANDLE: Twitter users name aka. Screen names

Check Output results at the top of your query editor and select your Twitter

...

Custom Audience connection as follows:

Image Modified

...


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

...

  • Custom Audience Name

...

  • (required): Name of

...

  • Custom Audience list to create.

    • Important note: If you have many Tailored Audience lists with similar names as this input, the latest

...

    • Custom Audience Name will be used. We recommend that you give your

...

    • Custom 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

...

Here is a sample configuration:

...

  • (optional, default to 32000) : Maximum time in milliseconds between retrying attempts.

...

Skip on Invalid Records? Ignore invalid records/errors and continue loading other records


  • Sample Configuration

Image Added

Write the Query to

...

Populate a Custom Audience List

Numbered Headings
start-numbering-with1
start-numbering-ath5
Treasure Data supports creation of a new

...

Custom Audience list.

...

On the Treasure Data console, run the following query

...

with Output results into a connection of Twitter

...

Custom Audience (see Appendix A for more details of column naming):
Code Block
linenumberstrue
SELECT email FROM (
  VALUES ('demo1@example.com'),
         ('demo2@example.com'),
         ('demo3@example.com')
)  tbl (email)


The preceding query will not match any real users as

...

it is for demo purposes only.

...

Further, it requires no source table (for the ease of testing out this feature), but you still need to choose your database, so pick “sample_datasets” or any other arbitrary table.

...

The query

...

completes in a few seconds.

Check the Twitter Audience Manager for your new list

...

.

...

Twitter takes up to 24 hours to validate your newly created list. Therefore, the list will show the status as “Processing”.

...

Image Added

You can see the status change to “Ready” (or an error if the list is not valid) within the next 6 to 8 hours.

Image Modified

Appendix

...

Custom Audience

...

Data

The Output result needs to follow the Twitter Tailored List Custom List data specifications here. We support single column, single type.

  • TWITTER_ID: Twitter user IDs

  • DEVICE_ID: IDFA, AdID or Android ID of Twitter users

  • EMAIL: Email addresses

  • TWITTER_HANDLE: Twitter users name aka. Screen names

Data Normalization and Hashing

Our result output can normalize your values automatically to follow Twitter’s normalizing rules. See here.

...

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

  • Email Addresses : Lowercase, remove leading and trailing spaces; ex: support@twitter.com

  • 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

After normalization, the data must be hashed using SHA256, without a salt.  Additionally, the final output hash must be in lower case. E.g., 49e0be2aeccfb51a8dee4c945c8a70a9ac500cf6f5cb08112575f74db9b1470d and 
For example, 49e0be2aeccfb51a8dee4c945c8a70a9ac500cf6f5cb08112575f74db9b1470d and not 49E0BE2AECCFB51A8DEE4C945C8A70A9AC500CF6F5CB08112575F74DB9B1470D

Twitter Ads Account

...

Information

Access to an Ads Account is the pre-requisite to create the Tailored Audience Custom Audience List. The account ID can be retrieved from the Account Settings Page

...