X Ads data model: campaigns, line items, promoted tweets and daily performance
X Ads, which many people still search as Twitter Ads, calls an ad group a line item and attaches a tweet to it through a promoted tweet.
01 · Free self-managed edition
OWOX Data Marts is open source: you can read the code that loads and models your data, and run it yourself.
02 · You own the data
X Ads tables load into your data warehouse, under your account. If you leave OWOX, they stay where they are.
03 · MCP-ready
Once the data is in, Claude or ChatGPT can work from your Data Marts through OWOX MCP.
Don't wire up X Ads by hand. Have your AI assistant load it into your data warehouse.
Your assistant sets up the X Ads connector with you and loads the tables you pick; OWOX keeps them in your data warehouse, ready to use.
The prompt
Read https://www.owox.com/ai-agent-setup.md and follow it to set up OWOX Data Marts for me, starting from /data-sources/x-ads.md. The task: set up the X Ads connector in OWOX Data Marts, let me pick the tables I need, load them into my data warehouse and show me the first rows. Tag the links you give me with utm_campaign=ai-task and utm_term=data-source. Use what you know about my context and goals
Prefer to start on your own? Get started free
The X Ads data model
X Ads
X Ads stacks an account, its campaigns, their line items and, at the bottom, promoted tweets, the rows that pin a tweet to a line item.
- Accounts, Campaigns, Line Items and Promoted Tweets carry the settings of each level; Tweets, Cards and All Cards carry the creatives; Targeting Locations is a reference table of countries.
- The chain joins on plain IDs: Promoted Tweets to Line Items on
line_item_id, Line Items to Campaigns oncampaign_id, and Campaigns to Accounts onaccount_id, a column the connector adds to each campaign when the field is selected. - Ad Performance and Ad Performance by Country report on promoted tweets, so their id joins to Promoted Tweets, and they are built only for the promoted tweets the connector has loaded, so line items that were deleted drop out of them.
- Tweet IDs run past 15 digits and the numeric id can arrive rounded, so match a promoted tweet to its text on the text
tweet_id. - Amounts ending in _micro are in millionths: 5.50 USD is stored as 5500000.
- Freshness: by default each incremental load reads the two statistics tables from 2 days before the last loaded date through today; the other tables are re-read on every run.
How the tables join (9)
Ad Performance joins to Promoted Tweetson
idN:1 (many to one)The promoted tweet the daily row reports on.
Ad Performance schemaPromoted Tweets schema
Fields of Ad Performance as the connector defines them (GitHub)
Ad Performance by Country joins to Promoted Tweetson
idN:1 (many to one)The promoted tweet the country row reports on.
Ad Performance by Country schemaPromoted Tweets schema
Fields of Ad Performance by Country as the connector defines them (GitHub)
Ad Performance by Country joins to Targeting Locationson
country = targeting_valueN:1 (many to one)The location the row is split by: country holds a location ID, not a name. The current X docs no longer list the LOCATIONS segmentation as enabled, so rows may be missing.
Campaigns joins to Accountson
account_id = idN:1 (many to one)The account the campaign belongs to; the connector fills account_id.
Cards joins to All Cardson
id1:1 (one to one)The same card seen through the plain cards list; All Cards holds only the cards attached to loaded tweets.
Line Items joins to Campaignson
campaign_id = idN:1 (many to one)The campaign the line item sits in.
Promoted Tweets joins to Line Itemson
line_item_id = idN:1 (many to one)The line item the tweet is promoted in.
Promoted Tweets schemaLine Items schema
Fields of Promoted Tweets as the connector defines them (GitHub)
Promoted Tweets joins to Tweetson
tweet_idN:1 (many to one)The tweet the promoted tweet attaches to the line item; matched on the text ID, since the numeric id can arrive rounded.
Tweets joins to All Cardson
card_uriN:1 (many to one)The card attached to the tweet; one card can be attached to several tweets.
Put the chain in your warehouse and the tables answer from campaign down to tweet; as Data Marts the joins come attached.
- Google Sheets
- ChatGPT
- Claude
The same published Data Marts feed Google Sheets reports and answer questions in ChatGPT or Claude, every number traced to a Data Mart.
OWOX for X Ads data: micros, zeros and tweet IDs explained
X Ads writes money in micros and hands out tweet IDs that lose digits when read as numbers, and the connector stores a zero for a metric the API does not return. The model describes each trap in the table that holds it, and the tables land in Google BigQuery, Snowflake, AWS Redshift, AWS Athena or Databricks.
- Country stats without starting the jobs. The connector pulls Ad Performance by Country through X Ads asynchronous stats jobs, one for each set of promoted tweets and placement, split by location, so no job is yours to start or poll.
- Both placements. Performance is requested for ALL_ON_TWITTER and PUBLISHER_NETWORK, so each promoted tweet has a row per placement and the table tells them apart.
- Zeros that mean not reported. A metric the API does not return is stored as 0, and the table description says so, so a zero is a value to check rather than to chart.
- Money you divide once. Amounts ending in _micro follow the X Ads documentation, and the model's descriptions repeat the rule, so you divide by 1,000,000 knowing why.
- Promoted-only tweets. Tweets lists the promoted-only tweets used as creatives, with their text, language, likes and reposts and the card attached to each; organic tweets are not loaded.
X Ads Endpoints
10 X Ads endpoints you can import. Each lands in its own table in your data warehouse.
Accounts
Advertising accounts — name, business, country, timezone, and approval status.
12 fieldsAd Performance
Daily ad performance by placement — impressions, clicks, spend, engagements, and social actions.
20 fieldsTime seriesAd Performance by Country
Daily ad performance broken down by country — impressions, clicks, spend, engagements, and social actions.
21 fieldsTime seriesAll Cards
All card types with full creative details — type, title, destination URL, call to action, and media.
30 fieldsCampaigns
Your campaigns — status, budget optimization, daily and total budget, and currency.
19 fieldsCards
Website and app cards — type, URI, and components.
8 fieldsLine Items
Line items within campaigns — bid strategy, goal, product type, budget, and schedule.
33 fieldsPromoted Tweets
Tweets promoted as ads — status, approval, and links to their tweets and line items.
8 fieldsTargeting Locations
Reference table of location IDs with names and country codes — join targeting_value with the country field in Ad Performance by Country.
4 fieldsTweets
Original tweets used as ad creatives — text, type, language, engagement counts, and card URI.
34 fields
X Ads Accounts schema
12 fieldsSchema on GitHubx_ads_accounts
Advertising accounts — name, business, country, timezone, and approval status.
Questions this table answers
- Which advertising accounts does this connector load, and what is the approval status of each?
- In which timezone and country is each account set up?
- Which accounts are marked as deleted, or do not have an accepted approval status?
| Field | Type | Description |
|---|---|---|
name | STRING | The name of the account |
business_name | STRING | The business name associated with the account |
timezone | STRING | The timezone of the account |
timezone_switch_at | DATETIME | When the timezone was last switched |
country_code | STRING | The country code of the account (e.g. SI) |
idPK | STRING | The unique identifier for the account |
created_at | DATETIME | When the account was created |
updated_at | DATETIME | When the account was last updated |
industry_type | STRING | The industry type of the account |
business_id | STRING | The business identifier associated with the account |
approval_status | STRING | The approval status of the account (e.g. ACCEPTED) |
deleted | BOOLEAN | Whether the account is deleted |
X Ads Ad Performance schema
20 fieldsTime seriesSchema on GitHubx_ads_stats
Daily ad performance by placement — impressions, clicks, spend, engagements, and social actions.
Questions this table answers
- What did each promoted tweet spend and return per day over the last 30 days?
- How do impressions, clicks and URL clicks compare between placements?
- Which promoted tweets have the lowest engagements per impression?
| Field | Type | Description |
|---|---|---|
idPK | STRING | The unique identifier for the stats record. |
datePK | STRING | The date for which the statistics were collected. |
placementPK | STRING | The placement type (ALL_ON_TWITTER or PUBLISHER_NETWORK). |
impressions | INTEGER | Number of impressions. |
tweets_send | INTEGER | Number of tweets sent. |
billed_charge_local_micro | INTEGER | Billed amount in micros. |
qualified_impressions | INTEGER | Number of qualified impressions. |
follows | INTEGER | Number of follows. |
app_clicks | INTEGER | Number of app clicks. |
retweets | INTEGER | Number of retweets. |
unfollows | INTEGER | Number of unfollows. |
likes | INTEGER | Number of likes. |
engagements | INTEGER | Number of engagements. |
clicks | INTEGER | Number of clicks. |
card_engagements | INTEGER | Number of card engagements. |
poll_card_vote | INTEGER | Number of poll card votes. |
replies | INTEGER | Number of replies. |
url_clicks | INTEGER | Number of URL clicks. |
billed_engagements | INTEGER | Number of billed engagements. |
carousel_swipes | INTEGER | Number of carousel swipes. |
Ad Performance by Country schema
X Ads Ad Performance by Country schema
21 fieldsTime seriesSchema on GitHubx_ads_stats_by_country
Daily ad performance broken down by country — impressions, clicks, spend, engagements, and social actions.
Questions this table answers
- Which countries bring the most clicks, and at what billed charge per click?
- Do promoted tweets get more engagements per impression in some countries than in others?
- Which promoted tweets reach more than one country?
| Field | Type | Description |
|---|---|---|
idPK | STRING | The unique identifier for the stats record. |
datePK | STRING | The date for which the statistics were collected. |
placementPK | STRING | The placement type (ALL_ON_TWITTER or PUBLISHER_NETWORK). |
countryPK | STRING | Location ID from X Ads (hex string, e.g. 96683cc9126741d1). Join with the targeting_locations node to get the human-readable name and country code. |
impressions | INTEGER | Number of impressions. |
tweets_send | INTEGER | Number of tweets sent. |
billed_charge_local_micro | INTEGER | Billed amount in micros. |
qualified_impressions | INTEGER | Number of qualified impressions. |
follows | INTEGER | Number of follows. |
app_clicks | INTEGER | Number of app clicks. |
retweets | INTEGER | Number of retweets. |
unfollows | INTEGER | Number of unfollows. |
likes | INTEGER | Number of likes. |
engagements | INTEGER | Number of engagements. |
clicks | INTEGER | Number of clicks. |
card_engagements | INTEGER | Number of card engagements. |
poll_card_vote | INTEGER | Number of poll card votes. |
replies | INTEGER | Number of replies. |
url_clicks | INTEGER | Number of URL clicks. |
billed_engagements | INTEGER | Number of billed engagements. |
carousel_swipes | INTEGER | Number of carousel swipes. |
X Ads All Cards schema
30 fieldsSchema on GitHubx_ads_cards_all
All card types with full creative details — type, title, destination URL, call to action, and media.
Questions this table answers
- Which cards use each call to action?
- Which destination URLs do the cards send clicks to?
- How many cards are video cards, and how long are their videos?
| Field | Type | Description |
|---|---|---|
idPK | STRING | The unique identifier for the card |
name | STRING | The name of the card |
card_type | STRING | Type of the card (e.g. IMAGE_APP_DOWNLOAD, VIDEO_WEBSITE) |
card_uri | STRING | URI of the card |
created_at | DATETIME | ISO-8601 timestamp when the card was created |
updated_at | DATETIME | ISO-8601 timestamp when the card was last updated |
deleted | BOOLEAN | Whether the card is deleted |
googleplay_app_id | STRING | Google Play application ID |
country_code | STRING | Country code associated with the app or destination |
wide_app_image | STRING | URL to the wide-aspect-ratio image used by the app card |
image_display_width | STRING | Width (in pixels) of the primary image displayed with the card |
image_display_height | STRING | Height (in pixels) of the primary image displayed with the card |
app_cta | STRING | Call-to-action used on the app card (e.g. INSTALL, OPEN) |
title | STRING | Title shown on the card |
website_url | STRING | Canonical website URL |
website_url_parsed | STRING | website_url resolved to its landing page when it is a short link; otherwise the same value. Requires website_url and Process Short Links. |
website_dest_url | STRING | Destination URL used for clicks |
website_dest_url_parsed | STRING | website_dest_url resolved to its landing page when it is a short link; otherwise the same value. Requires website_dest_url and Process Short Links. |
website_display_url | STRING | Display URL shown on the card |
website_shortened_url | STRING | Shortened (t.co) URL placed in the card |
video_url | STRING | URL of the video file or VMAP |
video_hls_url | STRING | HLS streaming URL |
video_poster_url | STRING | Poster image displayed before video playback |
video_content_id | STRING | Internal content identifier of the video |
video_owner_id | STRING | User ID of the video owner |
content_duration_seconds | STRING | Video duration in seconds |
video_width | STRING | Original width of the video |
video_height | STRING | Original height of the video |
video_poster_width | STRING | Width of the video poster image |
video_poster_height | STRING | Height of the video poster image |
X Ads Campaigns schema
19 fieldsSchema on GitHubx_ads_campaigns
Your campaigns — status, budget optimization, daily and total budget, and currency.
Questions this table answers
- Which campaigns are active, and which are not servable and for what reason?
- Which campaigns have a daily budget and which have only a total budget?
- How many campaigns does each account run on each budget optimization setting?
| Field | Type | Description |
|---|---|---|
name | STRING | The name of the campaign |
budget_optimization | STRING | Budget optimization strategy (e.g. LINE_ITEM) |
reasons_not_servable | ARRAY | Reasons why the campaign is not servable |
servable | BOOLEAN | Whether the campaign is servable |
purchase_order_number | STRING | Purchase order number |
effective_status | STRING | Effective status of the campaign (e.g. PAUSED) |
daily_budget_amount_local_micro | INTEGER | Daily budget amount in micros (nullable) |
funding_instrument_id | STRING | ID of the funding instrument |
duration_in_days | INTEGER | Duration of the campaign in days (nullable) |
standard_delivery | BOOLEAN | Whether standard delivery is enabled (nullable) |
total_budget_amount_local_micro | INTEGER | Total budget amount in micros (nullable) |
idPK | STRING | The unique identifier for the campaign |
entity_status | STRING | Entity status of the campaign |
frequency_cap | INTEGER | Frequency cap (nullable) |
currency | STRING | Currency code (e.g. USD) |
created_at | DATETIME | Timestamp when the campaign was created |
updated_at | DATETIME | Timestamp when the campaign was last updated |
deleted | BOOLEAN | Whether the campaign is deleted |
account_id | STRING | ID of the account |
X Ads Cards schema
8 fieldsSchema on GitHubx_ads_cards
Website and app cards — type, URI, and components.
Questions this table answers
- How many cards of each card type exist?
- Which cards were created in the last 90 days?
- Which cards are marked as deleted?
| Field | Type | Description |
|---|---|---|
idPK | STRING | The unique identifier for the card. |
name | STRING | The name of the card. |
card_type | STRING | Type of the card. |
card_uri | STRING | URI of the card. |
created_at | DATETIME | When the card was created. |
updated_at | DATETIME | When the card was last updated. |
deleted | BOOLEAN | Whether the card is deleted. |
components | ARRAY | Card components including media and buttons. |
X Ads Line Items schema
33 fieldsSchema on GitHubx_ads_line_items
Line items within campaigns — bid strategy, goal, product type, budget, and schedule.
Questions this table answers
- How many line items does each campaign have, and how many are paused?
- Which line items use each bid strategy and goal?
- Which line items have an end time that has already passed but are still active?
| Field | Type | Description |
|---|---|---|
advertiser_user_id | STRING | ID of the advertiser user |
name | STRING | Name of the line item |
placements | ARRAY | List of placement targets (e.g. ALL_ON_TWITTER) |
start_time | DATETIME | Line item start time |
bid_amount_local_micro | INTEGER | Bid amount in micro-currency units |
advertiser_domain | STRING | Domain of the advertiser |
target_cpa_local_micro | INTEGER | Target CPA (cost per action) in micro-currency units |
primary_web_event_tag | STRING | Primary web event tag identifier |
goal | STRING | Line item goal/objective (e.g. APP_INSTALLS) |
daily_budget_amount_local_micro | INTEGER | Daily budget in micro-currency units |
product_type | STRING | Product type (e.g. PROMOTED_TWEETS) |
end_time | DATETIME | Line item end time (nullable) |
funding_instrument_id | STRING | ID of the funding instrument |
bid_strategy | STRING | Bidding strategy (e.g. AUTO) |
duration_in_days | INTEGER | Duration in days (nullable) |
standard_delivery | BOOLEAN | Whether standard delivery is enabled |
total_budget_amount_local_micro | INTEGER | Total budget in micro-currency units (nullable) |
objective | STRING | Campaign objective (duplicate of goal in some APIs) |
idPK | STRING | Unique identifier of the line item |
entity_status | STRING | Status of the line item (e.g. ACTIVE, PAUSED) |
automatic_tweet_promotion | BOOLEAN | Whether automatic tweet promotion is enabled |
frequency_cap | INTEGER | Frequency cap for ad serving |
android_app_store_identifier | STRING | Android app store identifier |
categories | ARRAY | Array of category labels |
currency | STRING | Currency code (e.g. USD) |
pay_by | STRING | Payment method (e.g. IMPRESSION) |
created_at | DATETIME | Timestamp when the line item was created |
ios_app_store_identifier | STRING | iOS app store identifier |
updated_at | DATETIME | Timestamp when the line item was last updated |
campaign_id | STRING | ID of the parent campaign |
creative_source | STRING | Source of the creative (e.g. MANUAL) |
audience_expansion | STRING | Audience expansion setting (e.g. EXPANDED) |
deleted | BOOLEAN | Whether the line item is marked as deleted |
X Ads Promoted Tweets schema
8 fieldsSchema on GitHubx_ads_promoted_tweets
Tweets promoted as ads — status, approval, and links to their tweets and line items.
Questions this table answers
- How many promoted tweets does each line item have, and how many are paused?
- Which promoted tweets have an approval status other than accepted?
- Which tweets are promoted in more than one line item?
| Field | Type | Description |
|---|---|---|
line_item_id | STRING | ID of the parent line item |
idPK | STRING | Unique identifier for the promoted tweet |
entity_status | STRING | Status of the promoted tweet (e.g., ACTIVE, PAUSED) |
created_at | DATETIME | Timestamp when the promoted tweet was created |
updated_at | DATETIME | Timestamp when the promoted tweet was last updated |
approval_status | STRING | Approval status of the promoted tweet (e.g., ACCEPTED, REJECTED) |
tweet_id | STRING | ID of the original tweet |
deleted | BOOLEAN | Flag indicating whether the promoted tweet has been deleted |
X Ads Targeting Locations schema
4 fieldsSchema on GitHubx_ads_targeting_locations
Reference table of location IDs with names and country codes — join targeting_value with the country field in Ad Performance by Country.
Questions this table answers
- What are the names and country codes of the locations the connector loads?
- Which country code belongs to each location ID?
- How many locations of each location type are in the table?
| Field | Type | Description |
|---|---|---|
targeting_valuePK | STRING | Unique hex ID for this location (e.g. 96683cc9126741d1). Use this to join with the country field in stats_by_country. |
name | STRING | Human-readable location name (e.g. United States, California). |
location_type | STRING | Type of location: COUNTRIES, REGIONS, CITIES, METROS, or POSTAL_CODES. |
country_code | STRING | ISO 2-letter country code (e.g. US, DE, NL). |
X Ads Tweets schema
34 fieldsSchema on GitHubx_ads_tweets
Original tweets used as ad creatives — text, type, language, engagement counts, and card URI.
Questions this table answers
- Which promoted-only tweets carry a card, and which do not?
- Which tweets have the most likes and reposts?
- In which languages are the promoted tweets written?
| Field | Type | Description |
|---|---|---|
coordinates | OBJECT | The geographic coordinates (latitude/longitude) of the tweet, if available. |
retweeted | BOOLEAN | Whether this tweet is a retweet of another tweet. |
name | STRING | A custom name or label for the tweet. |
conversation_settings | STRING | Who can reply or interact with the tweet (e.g. EVERYONE). |
source | STRING | HTML markup indicating the client or interface used to post the tweet. |
entities | OBJECT | Parsed entities in the tweet (mentions, hashtags, URLs, media, etc.). |
display_text_range | ARRAY | Start/end indices for which portion of the tweet text to display. |
favorite_count | INTEGER | Number of times the tweet has been liked. |
in_reply_to_status_id_str | STRING | ID (as string) of the tweet this one is replying to. |
geo | OBJECT | Deprecated geographic information, if present. |
id_str | STRING | The tweet’s unique identifier, as a string. |
scopes | OBJECT | Visibility scopes (e.g. { followers: false }). |
in_reply_to_user_id | INTEGER | Numeric ID of the user this tweet is replying to. |
truncated | BOOLEAN | Whether the tweet text has been truncated. |
retweet_count | INTEGER | Number of times this tweet has been retweeted. |
scheduled_status | STRING | Scheduled status (e.g. pending scheduling), if any. |
idPK | INTEGER | The tweet’s unique identifier, as a number. |
in_reply_to_status_id | INTEGER | Numeric ID of the tweet this one is replying to. |
possibly_sensitive | BOOLEAN | Whether the tweet may contain sensitive content. |
nullcast | BOOLEAN | Whether the tweet is nullcast (not shown on timeline). |
created_at | STRING | Creation timestamp of the tweet. |
place | OBJECT | Place (location) associated with the tweet, if any. |
scheduled_at | STRING | When the tweet was scheduled for posting. |
tweet_type | STRING | Type of tweet (e.g. PUBLISHED). |
favorited | BOOLEAN | Whether the authenticated user has liked the tweet. |
card_uri | STRING | URI of the associated Twitter Card. |
full_text | STRING | The full text content of the tweet. |
lang | STRING | Language code of the tweet (e.g. en). |
contributors | ARRAY | Array of contributors to the tweet, if any. |
in_reply_to_screen_name | STRING | Screen name of the user this tweet is replying to. |
in_reply_to_user_id_str | STRING | ID (as string) of the user this tweet is replying to. |
user | OBJECT | The user object of the author (contains id, id_str, etc.). |
tweet_id | STRING | Duplicate of id_str (the tweet’s ID as a string). |
extended_entities | OBJECT | Extended media entities (e.g. video variants, additional media info). |
What X Ads data answers
Across the tables
- Which campaigns spend the most for the fewest clicks, once spend is divided by clicks?
- How do impressions, clicks and engagements change from campaign to line item to promoted tweet?
- Which countries do promoted tweets reach, and which of them engage?
Industry data models that use X Ads
Industry data models that use X Ads
- E-CommerceEcommerce12 data marts, 87 fields
- E-Commerce ExtendedEcommerce20 data marts, 125 fields
- E-commerce Subscription StoreEcommerce15 data marts, 189 fields
- Marketing LeadgenAgency9 data marts, 81 fields
- MeasureCamp11 data marts, 61 fields
- SaaSSaaS10 data marts, 99 fields
- TradingFinance8 data marts, 168 fields
Where X Ads data goes
Data warehouses
AI assistants
Spreadsheets
Dashboards
Messages
API
- 0.41.0Rotating a connector key is one change: Sources share reusable Credentials
- 0.37.0Short links resolve only on known short link services and domains you allow
- 0.36.0Resolve short links in every ads connector, with nested paths and a per-Data-Mart cache
- 0.33.0Resumable incremental imports for Microsoft Ads, Google Ads, Reddit Ads, Criteo, and X Ads
- 0.28.0Reliable incremental sync after partial connector run
The Data Partner You Can Trust
users
166K Source: Internal OWOX data as of 2026-11-15
Executives and data analysts across 20+ industries
Customers
You are booked. The invitation is on its way to , with the calendar invite and the meeting link.