Skip to content

How to Import Data from X Ads Source

Before you start, verify:

  • Click New Data Mart (available from any page in OWOX Data Marts).
  • Enter a title and select the Storage. If you haven’t configured a storage yet, click New Storage to create one now and configure it later.
  • Click Create Data Mart.

Create Data Mart dialog with Title set to "X Ads Data Mart", Storage selected, and the Create Data Mart button

  1. Select Connector as the definition type.
  2. Click Set up connector and choose X Ads.
  3. Fill in the required fields:
    • Consumer Key and Consumer Secret – from the Keys & Tokens section of your X developer app.
    • Access Token and Access Token Secret – final user tokens from the Credentials Guide.
    • Account ID – find it in your ads.x.com URL. For example, in https://ads.x.com/campaign_form/18ce55in6wt/campaign/new, the Account ID is 18ce55in6wt. To add multiple accounts, separate them with commas.
  4. Leave all other fields as default.

Data Setup page showing the Definition Type dropdown with Connector option highlighted

Set Up Connector panel for X Ads showing fields for Consumer Key, Consumer Secret, Access Token, Access Token Secret, and Account ID

X Ads Manager page showing the Account ID highlighted in the URL bar and in the account sidebar

  1. Choose one of the available endpoints. Start with Ad Performance for daily metrics (impressions, clicks, spend).
  2. Select the required fields or leave defaults.
  3. Specify the dataset name in your storage (for example, a BigQuery dataset). OWOX creates it automatically if it doesn’t exist. The table name is auto-generated from the endpoint name (for example, x_ads_stats). Leave the default if you’re unsure.
  4. Click Finish, then Publish & Run Data Mart.

X Ads Data Mart Data Setup page with the Publish & Run Data Mart button highlighted

The first run imports data from the 1st of the previous month through today.

The connector does not run again automatically. Set up a trigger to schedule recurring imports.

  1. Open the Triggers tab of your Data Mart.
  2. Click + Add Trigger.
  3. Set Trigger Type to Connector Run.
  4. Choose a schedule: Daily, Weekly, Monthly, or Interval.
  5. Click Save.

For one-off imports, choose one of the following options. Use Incremental to refresh recent data. Use Backfill to reload a specific historical period — for example, after adding new fields or fixing a data error.

Choose Manual Run → Incremental load.

It imports today’s data, plus the number of previous days set in Reimport Lookback Window (default: 2 days). Change this value in the connector’s Advanced Settings tab.

Published X Ads Data Mart showing the three-dot menu open with the Manual Run option circled

Manual Run dialog with Incremental load selected, showing the description of adding only new or updated records

Connector Advanced Settings showing the Reimport Lookback Window field set to 2

Option 2: Backfill for a Specific Date Range

Section titled “Option 2: Backfill for a Specific Date Range”

Choose Manual Run → Backfill (custom period) to load historical data.

  1. Select the Start Date and End Date.
  2. Click Run.

Manual Run dialog with Backfill (custom period) selected, showing Start Date and End Date fields

The run is complete when the Run History tab shows Success. A first run typically takes a few minutes for small accounts and longer for accounts with large data volumes.

Run History tab showing a completed run with a Success status

Once the run completes, OWOX writes data to the dataset you specified. Open your storage console (for example, BigQuery or Snowflake) and navigate to that dataset. Each endpoint creates a separate table named after it — for example, x_ads_stats for Ad Performance data.

Check the Run History tab for error messages. To update credentials or connector settings, open the Data Setup tab of your Data Mart, edit the fields, and click Save. Common errors and fixes:

[UNKNOWN] HttpRequestException: The client application making this request does not have access to Twitter Ads API

X hasn’t approved your Ads API access yet. Return to Step 2: Request Ads API Access in the Credentials Guide and submit the request.

Run History tab showing a failed run with the HttpRequestException error about missing Twitter Ads API access

[UNKNOWN] HttpRequestException: Could not authenticate you.

The Consumer Key or Consumer Secret is wrong. Re-enter them from Step 1 or Step 3 of the Credentials Guide.

[UNKNOWN] HttpRequestException: Invalid or expired token.

The Access Token or Access Token Secret in the connector is wrong, revoked, or does not match the other credentials. Redo Steps 4–6 of the Credentials Guide and use the final oauth_token and oauth_token_secret from Step 6.

Update both values in the Data Setup tab. Use the permanent token pair from Step 6, not the temporary token pair from Step 4.

[UNKNOWN] HttpRequestException: Account was not found

Your X account doesn’t have an active Premium or Premium+ subscription required for X Ads Manager. If your subscription is active, double-check the Account ID in your ads.x.com URL and update it in the Data Setup tab.

Run History detail page showing the Raw tab with the JSON error output for the Account was not found error

[UNKNOWN] HttpRequestException: You are not permitted to perform this action

Your X account lacks permission for this endpoint. Re-check your account’s access level and try again.

For anything else: