Skip to main content

Twitter Ads integration plan

Last updated 10/03/2026
tip

Note that data generated by third-party data integration counts toward the cluster's data consumption

Summary​

Interface overview​

InterfaceTypeGranularityAttributionCostRevenueImpressionsClicksConversions
Analytic APIAPIAggregated metrics✅✅✅✅

The Twitter Ads Analytic API is an aggregated data API provided by Twitter. It offers both synchronous and asynchronous data APIs. Because the asynchronous data API is better than the synchronous one in both analysis capabilities and data time range, the AE system supports ingesting data from the asynchronous data API.

Integration process​

The process for ingesting Twitter Ads data is as follows:

  1. On the Twitter platform, you need to:

    1. Get a Twitter Developer account, create an APP, and get the API Key and API Token
    2. Apply for access to the Ads API
    3. Create the Access Token and Access Secret of the ad account (if you created an Access Token and Access Secret before applying for the Ads API, you need to regenerate them)
  2. Log in to the AE backend, go to the Third-party Integration module, add a Twitter Ads integration, and create an integration plan

  3. Check whether the AE system receives the data successfully, and build reports

1. Preparation before integration​

1.1 Apply for a Twitter developer account and create an APP​

To call the Twitter API to get Twitter Ads data, you first need to apply for a Twitter developer account. Developer account applications are reviewed by Twitter.

After the application is approved, create an APP and write down its API Key and API Token for calling the Ads API later.

1.2 Apply for access to the Ads API​

After you have a Twitter developer account and have created the APP, contact Twitter staff to enable Ads API access for your developer account. The application may take several days.

1.3 Get the Access Token and Access Secret​

After Ads API access is enabled, you need to get the Access Token and Access Secret. Go back to the developer platform, click the app that has been granted Ads API access, open the Keys and tokens tab, and click the Generate button in the Access Token and Secret section to create the Access Token and Access Secret. Keep the account's Access Token and Access Secret safe. You will need them to call the Ads API later.

1.4 Summary​

You need to get the following information from Twitter:

  1. The API Key and API Key Secret of the Twitter app
  2. The Access Token and Access Secret of the ad account
  3. The Account ID of the ad account

2. Plan configuration​

After you finish preparing on the Twitter Ads platform, log in to the AE system and configure the new plan in the Third-party Integration module. The image below shows the configuration page of the Twitter Ads Analytic API. Follow this section to create the plan:

2.1 Authorization information configuration​

Click the Configure authorization information button under Authorization Information and enter the information you got from the Twitter Ads platform in the pop-up

In Account ID List, enter the IDs of the Twitter ad accounts whose data you want to pull. Separate multiple ad account IDs with ","

2.2 Sync Schedule​

In the Sync Schedule module, you can set the policy for the AE system to pull Twitter Ads Analytic API data on a schedule. You can choose to pull data for a period of time at a specific time every day or every hour. Because pulled data also counts toward the data volume, avoid pulling data for overly long periods on a schedule

2.3 Event Data Configuration​

After you turn on the Event Data Configuration switch, all data sent back is written to the event table. We recommend that you enable event data ingestion.

2.4 Configuration​

Finally, in the Configuration module, you can control the detailed settings of data pulling, including the time aggregation granularity of the data, the metric fields and dimensions to pull, and the event name after ingestion.

The content of the configuration is a JSON, which you can customize as follows:

ModuleNameDescription
sink_eventevent_nameEvent name after ingestion; customizable; string type.
source

time_granularity

Time granularity of data pulling. Options:

  • Day: day
  • Hour: hour
metricsMetric fields of the corresponding API; list type; customizable
transferdouble_columnsMetrics in the data. List type. These fields are ingested as numeric values when the data is received, and the other fields are ingested as strings (or time)
  • Grouping dimensions

Twitter Ads refers to each level of ad dimension, such as Campaign and Ad Group, as an "Entity". When you call the Analytic API, only one analysis dimension is allowed. To get as much ad dimension information as possible, the AE system uses the finest granularity, PROMOTED_TWEET, as the analysis entity when pulling data, and gets information about higher-level entities, such as Campaign ID and Line Item ID, through the entity association API. The following table shows all dimension fields and their meanings:

Dimension nameDescription
account_idAd account ID
campaign_idCampaign ID
campaign_nameCampaign name
line_item_idLine Item ID(Ad set ID)
line_item_nameLine Item Name (Ad set name)
promoted_tweet_idTweet ID
placementPlacement
entity_idEntity ID
currencyCurrency
  • Metric fields

The Analytic API provides multiple metric groups to choose from, and each metric group covers multiple metric fields. You can customize the metric groups to pull. The following table shows the common metrics of each metric group. For information on all metrics, see the official Twitter documentation. To adjust them, add the metric group names to source.metrics and the metric field names to transfer.double_columns

Metric groupMetric fieldDescriptionDefault

ENGAGEMENT

engagementsTotal engagements (including organic impressions, retweets, replies, shares, likes, and other actions)Yes
impressionsOrganic impressions (excluding paid promotion)Yes
retweetsRetweetsYes
repliesRepliesYes
likesLikesYes
followsFollowsYes
card_engagementsTotal card engagementsYes
clicksClicksYes
app_clicksApp installs or app opens after clicksYes
url_clicksClicks on tweet links or website cardsYes
qualified_impressionsFully displayed impressionsYes
carousel_swipesSwipes on carousel images or videosYes
BILLINGbilled_engagementsBilled engagementsYes
billed_charge_local_microTotal billed amount (multiplied by 1000000)Yes

VIDEO

video_total_viewsVideo playsYes
video_views_25Video views at 25% progressYes
video_views_50Video views at 50% progressYes
video_views_75Video views at 75% progressYes
video_views_100Video completionsYes
video_cta_clicksCall-to-action clicksYes
video_content_startsVideo content startsYes
video_3s100pct_viewsVideo completions (watched for at least 3 seconds)Yes
video_6s_views6-second video viewsYes
video_15s_viewsVideo views of 15 seconds or 95% progressYes
MEDIAmedia_viewsMedia views (including autoplay and click-to-play)Yes
media_engagementsMedia engagementsYes
WEB_CONVERSIONconversion_*Conversions from conversion events of type PURCHASE, SIGN_UP, SITE_VISIT, DOWNLOAD, or CUSTOM that are followed by a payment
MOBILE_CONVERSIONmobile_conversion_*
LIFE_TIME_VALUE_MOBILE_CONVERSION

mobile_conversion_lifetime_value_*

2.5 Event ingestion rules​

  • The day field in the data, that is, the date of the data, is set as the #event_time of the aggregated data
  • The default event name of the data is -- twitter_ads_data
  • Metric fields are ingested as numeric values, and other fields are ingested as strings

2.6 Standardized fields​

The AE system standardizes some fields in Twitter Ads Analytic API data:

FieldStandardized fieldDescription
account_idte_ads_object.ad_account_idAd account ID
campaign_namete_ads_object.campaign_nameCampaign name
campaign_idte_ads_object.campaign_idCampaign ID
line_item_namete_ads_object.ad_group_nameAd group name
line_item_idte_ads_object.ad_group_idAd group ID
promoted_tweet_idte_ads_object.ad_idAd ID
placementte_ads_object.placementAd placement
currencyte_ads_object.currencyCurrency of the cost or revenue
impressionste_ads_object.impressionsImpressions
clickste_ads_object.clicksClicks
billed_charge_local_micro (divided by 1000000)te_ads_object.costUser acquisition cost
Was this page helpful?