Data source

X Ads logo

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.

Hand this to your AI

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

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

The X Ads data model

The X Ads data model

10 tables189 fields9 joinsView on GitHub

Accounts12 fields1 relationshipAd Performance20 fields1 relationshipStart hereAd Performance by CountryAd Performance by C…21 fields2 relationshipsAll Cards30 fields2 relationshipsCampaigns19 fields2 relationshipsCards8 fields1 relationshipLine Items33 fields2 relationshipsPromoted Tweets8 fields4 relationshipsTargeting Locations4 fields1 relationshipTweets34 fields2 relationships
Source
  • 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.

  1. 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.
  2. The chain joins on plain IDs: Promoted Tweets to Line Items on line_item_id, Line Items to Campaigns on campaign_id, and Campaigns to Accounts on account_id, a column the connector adds to each campaign when the field is selected.
  3. 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.
  4. 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.
  5. Amounts ending in _micro are in millionths: 5.50 USD is stored as 5500000.
  6. 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)

Put the chain in your data warehouse and the tables answer from campaign down to tweet; as Data Marts the joins come attached.

Explore on canvas →Import this model

Use it in your tools

The same published Data Marts feed Google Sheets reports and answer questions in ChatGPT or Claude, every number traced to a Data Mart.

Why OWOX

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.

Endpoints

Accounts schema

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?
X Ads Accounts fields
FieldTypeDescription
nameSTRINGThe name of the account
business_nameSTRINGThe business name associated with the account
timezoneSTRINGThe timezone of the account
timezone_switch_atDATETIMEWhen the timezone was last switched
country_codeSTRINGThe country code of the account (e.g. SI)
idPKSTRINGThe unique identifier for the account
created_atDATETIMEWhen the account was created
updated_atDATETIMEWhen the account was last updated
industry_typeSTRINGThe industry type of the account
business_idSTRINGThe business identifier associated with the account
approval_statusSTRINGThe approval status of the account (e.g. ACCEPTED)
deletedBOOLEANWhether the account is deleted

Ad Performance schema

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?
X Ads Ad Performance fields
FieldTypeDescription
idPKSTRINGThe unique identifier for the stats record.
datePKSTRINGThe date for which the statistics were collected.
placementPKSTRINGThe placement type (ALL_ON_TWITTER or PUBLISHER_NETWORK).
impressionsINTEGERNumber of impressions.
tweets_sendINTEGERNumber of tweets sent.
billed_charge_local_microINTEGERBilled amount in micros.
qualified_impressionsINTEGERNumber of qualified impressions.
followsINTEGERNumber of follows.
app_clicksINTEGERNumber of app clicks.
retweetsINTEGERNumber of retweets.
unfollowsINTEGERNumber of unfollows.
likesINTEGERNumber of likes.
engagementsINTEGERNumber of engagements.
clicksINTEGERNumber of clicks.
card_engagementsINTEGERNumber of card engagements.
poll_card_voteINTEGERNumber of poll card votes.
repliesINTEGERNumber of replies.
url_clicksINTEGERNumber of URL clicks.
billed_engagementsINTEGERNumber of billed engagements.
carousel_swipesINTEGERNumber 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?
X Ads Ad Performance by Country fields
FieldTypeDescription
idPKSTRINGThe unique identifier for the stats record.
datePKSTRINGThe date for which the statistics were collected.
placementPKSTRINGThe placement type (ALL_ON_TWITTER or PUBLISHER_NETWORK).
countryPKSTRINGLocation ID from X Ads (hex string, e.g. 96683cc9126741d1). Join with the targeting_locations node to get the human-readable name and country code.
impressionsINTEGERNumber of impressions.
tweets_sendINTEGERNumber of tweets sent.
billed_charge_local_microINTEGERBilled amount in micros.
qualified_impressionsINTEGERNumber of qualified impressions.
followsINTEGERNumber of follows.
app_clicksINTEGERNumber of app clicks.
retweetsINTEGERNumber of retweets.
unfollowsINTEGERNumber of unfollows.
likesINTEGERNumber of likes.
engagementsINTEGERNumber of engagements.
clicksINTEGERNumber of clicks.
card_engagementsINTEGERNumber of card engagements.
poll_card_voteINTEGERNumber of poll card votes.
repliesINTEGERNumber of replies.
url_clicksINTEGERNumber of URL clicks.
billed_engagementsINTEGERNumber of billed engagements.
carousel_swipesINTEGERNumber of carousel swipes.

All Cards schema

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?
X Ads All Cards fields
FieldTypeDescription
idPKSTRINGThe unique identifier for the card
nameSTRINGThe name of the card
card_typeSTRINGType of the card (e.g. IMAGE_APP_DOWNLOAD, VIDEO_WEBSITE)
card_uriSTRINGURI of the card
created_atDATETIMEISO-8601 timestamp when the card was created
updated_atDATETIMEISO-8601 timestamp when the card was last updated
deletedBOOLEANWhether the card is deleted
googleplay_app_idSTRINGGoogle Play application ID
country_codeSTRINGCountry code associated with the app or destination
wide_app_imageSTRINGURL to the wide-aspect-ratio image used by the app card
image_display_widthSTRINGWidth (in pixels) of the primary image displayed with the card
image_display_heightSTRINGHeight (in pixels) of the primary image displayed with the card
app_ctaSTRINGCall-to-action used on the app card (e.g. INSTALL, OPEN)
titleSTRINGTitle shown on the card
website_urlSTRINGCanonical website URL
website_url_parsedSTRINGwebsite_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_urlSTRINGDestination URL used for clicks
website_dest_url_parsedSTRINGwebsite_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_urlSTRINGDisplay URL shown on the card
website_shortened_urlSTRINGShortened (t.co) URL placed in the card
video_urlSTRINGURL of the video file or VMAP
video_hls_urlSTRINGHLS streaming URL
video_poster_urlSTRINGPoster image displayed before video playback
video_content_idSTRINGInternal content identifier of the video
video_owner_idSTRINGUser ID of the video owner
content_duration_secondsSTRINGVideo duration in seconds
video_widthSTRINGOriginal width of the video
video_heightSTRINGOriginal height of the video
video_poster_widthSTRINGWidth of the video poster image
video_poster_heightSTRINGHeight of the video poster image

Campaigns schema

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?
X Ads Campaigns fields
FieldTypeDescription
nameSTRINGThe name of the campaign
budget_optimizationSTRINGBudget optimization strategy (e.g. LINE_ITEM)
reasons_not_servableARRAYReasons why the campaign is not servable
servableBOOLEANWhether the campaign is servable
purchase_order_numberSTRINGPurchase order number
effective_statusSTRINGEffective status of the campaign (e.g. PAUSED)
daily_budget_amount_local_microINTEGERDaily budget amount in micros (nullable)
funding_instrument_idSTRINGID of the funding instrument
duration_in_daysINTEGERDuration of the campaign in days (nullable)
standard_deliveryBOOLEANWhether standard delivery is enabled (nullable)
total_budget_amount_local_microINTEGERTotal budget amount in micros (nullable)
idPKSTRINGThe unique identifier for the campaign
entity_statusSTRINGEntity status of the campaign
frequency_capINTEGERFrequency cap (nullable)
currencySTRINGCurrency code (e.g. USD)
created_atDATETIMETimestamp when the campaign was created
updated_atDATETIMETimestamp when the campaign was last updated
deletedBOOLEANWhether the campaign is deleted
account_idSTRINGID of the account

Cards schema

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?
X Ads Cards fields
FieldTypeDescription
idPKSTRINGThe unique identifier for the card.
nameSTRINGThe name of the card.
card_typeSTRINGType of the card.
card_uriSTRINGURI of the card.
created_atDATETIMEWhen the card was created.
updated_atDATETIMEWhen the card was last updated.
deletedBOOLEANWhether the card is deleted.
componentsARRAYCard components including media and buttons.

Line Items schema

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?
X Ads Line Items fields
FieldTypeDescription
advertiser_user_idSTRINGID of the advertiser user
nameSTRINGName of the line item
placementsARRAYList of placement targets (e.g. ALL_ON_TWITTER)
start_timeDATETIMELine item start time
bid_amount_local_microINTEGERBid amount in micro-currency units
advertiser_domainSTRINGDomain of the advertiser
target_cpa_local_microINTEGERTarget CPA (cost per action) in micro-currency units
primary_web_event_tagSTRINGPrimary web event tag identifier
goalSTRINGLine item goal/objective (e.g. APP_INSTALLS)
daily_budget_amount_local_microINTEGERDaily budget in micro-currency units
product_typeSTRINGProduct type (e.g. PROMOTED_TWEETS)
end_timeDATETIMELine item end time (nullable)
funding_instrument_idSTRINGID of the funding instrument
bid_strategySTRINGBidding strategy (e.g. AUTO)
duration_in_daysINTEGERDuration in days (nullable)
standard_deliveryBOOLEANWhether standard delivery is enabled
total_budget_amount_local_microINTEGERTotal budget in micro-currency units (nullable)
objectiveSTRINGCampaign objective (duplicate of goal in some APIs)
idPKSTRINGUnique identifier of the line item
entity_statusSTRINGStatus of the line item (e.g. ACTIVE, PAUSED)
automatic_tweet_promotionBOOLEANWhether automatic tweet promotion is enabled
frequency_capINTEGERFrequency cap for ad serving
android_app_store_identifierSTRINGAndroid app store identifier
categoriesARRAYArray of category labels
currencySTRINGCurrency code (e.g. USD)
pay_bySTRINGPayment method (e.g. IMPRESSION)
created_atDATETIMETimestamp when the line item was created
ios_app_store_identifierSTRINGiOS app store identifier
updated_atDATETIMETimestamp when the line item was last updated
campaign_idSTRINGID of the parent campaign
creative_sourceSTRINGSource of the creative (e.g. MANUAL)
audience_expansionSTRINGAudience expansion setting (e.g. EXPANDED)
deletedBOOLEANWhether the line item is marked as deleted

Promoted Tweets schema

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?
X Ads Promoted Tweets fields
FieldTypeDescription
line_item_idSTRINGID of the parent line item
idPKSTRINGUnique identifier for the promoted tweet
entity_statusSTRINGStatus of the promoted tweet (e.g., ACTIVE, PAUSED)
created_atDATETIMETimestamp when the promoted tweet was created
updated_atDATETIMETimestamp when the promoted tweet was last updated
approval_statusSTRINGApproval status of the promoted tweet (e.g., ACCEPTED, REJECTED)
tweet_idSTRINGID of the original tweet
deletedBOOLEANFlag indicating whether the promoted tweet has been deleted

Targeting Locations schema

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?
X Ads Targeting Locations fields
FieldTypeDescription
targeting_valuePKSTRINGUnique hex ID for this location (e.g. 96683cc9126741d1). Use this to join with the country field in stats_by_country.
nameSTRINGHuman-readable location name (e.g. United States, California).
location_typeSTRINGType of location: COUNTRIES, REGIONS, CITIES, METROS, or POSTAL_CODES.
country_codeSTRINGISO 2-letter country code (e.g. US, DE, NL).

Tweets schema

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?
X Ads Tweets fields
FieldTypeDescription
coordinatesOBJECTThe geographic coordinates (latitude/longitude) of the tweet, if available.
retweetedBOOLEANWhether this tweet is a retweet of another tweet.
nameSTRINGA custom name or label for the tweet.
conversation_settingsSTRINGWho can reply or interact with the tweet (e.g. EVERYONE).
sourceSTRINGHTML markup indicating the client or interface used to post the tweet.
entitiesOBJECTParsed entities in the tweet (mentions, hashtags, URLs, media, etc.).
display_text_rangeARRAYStart/end indices for which portion of the tweet text to display.
favorite_countINTEGERNumber of times the tweet has been liked.
in_reply_to_status_id_strSTRINGID (as string) of the tweet this one is replying to.
geoOBJECTDeprecated geographic information, if present.
id_strSTRINGThe tweet’s unique identifier, as a string.
scopesOBJECTVisibility scopes (e.g. { followers: false }).
in_reply_to_user_idINTEGERNumeric ID of the user this tweet is replying to.
truncatedBOOLEANWhether the tweet text has been truncated.
retweet_countINTEGERNumber of times this tweet has been retweeted.
scheduled_statusSTRINGScheduled status (e.g. pending scheduling), if any.
idPKINTEGERThe tweet’s unique identifier, as a number.
in_reply_to_status_idINTEGERNumeric ID of the tweet this one is replying to.
possibly_sensitiveBOOLEANWhether the tweet may contain sensitive content.
nullcastBOOLEANWhether the tweet is nullcast (not shown on timeline).
created_atSTRINGCreation timestamp of the tweet.
placeOBJECTPlace (location) associated with the tweet, if any.
scheduled_atSTRINGWhen the tweet was scheduled for posting.
tweet_typeSTRINGType of tweet (e.g. PUBLISHED).
favoritedBOOLEANWhether the authenticated user has liked the tweet.
card_uriSTRINGURI of the associated Twitter Card.
full_textSTRINGThe full text content of the tweet.
langSTRINGLanguage code of the tweet (e.g. en).
contributorsARRAYArray of contributors to the tweet, if any.
in_reply_to_screen_nameSTRINGScreen name of the user this tweet is replying to.
in_reply_to_user_id_strSTRINGID (as string) of the user this tweet is replying to.
userOBJECTThe user object of the author (contains id, id_str, etc.).
tweet_idSTRINGDuplicate of id_str (the tweet’s ID as a string).
extended_entitiesOBJECTExtended media entities (e.g. video variants, additional media info).

What X Ads data answers

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

Where X Ads data goes

Recent updates

Other data sources

Trust

The Data Partner You Can Trust

users

166K Source: Internal OWOX data as of 2026-11-15

Executives and data analysts across 20+ industries

G2 rating

4.9★2

“A trusted data analytics partner” — verified review

npm installs

171K3

In Open Source We Trust

Customers