X Ads (formerly Twitter Ads)
3 minute read
X Ads (formerly Twitter Ads) is an advertising platform that lets you track and monitor ad campaigns, clicks, CTRs, etc. You can also implement efficient ad retargeting for your customers.
Find the open source transformation code for this destination in the GitHub repository.
Connection compatibility
| Destination Information | |||
|---|---|---|---|
| |||
Get started
- From your RudderStack dashboard, add a source. Then, from the list of destinations, select X Ads.
- Assign a name to the destination and click Continue.
Account settings
- Click the Create Account button.
- Under Choose an account, click the Connect with X Ads button and give RudderStack the required permissions to access your account. Then, click Save.
- To verify or change your account, click the Edit Credentials button.

Connection settings
| Setting | Description |
|---|---|
| Pixel ID | Enter the Universal Website Tag (UWT) ID for your X Ads account. See FAQ for more information on obtaining the Pixel ID. |
| Map RudderStack event name to X event ID | This setting lets you map your RudderStack Event Name to a specific Twitter Event ID. See FAQ for more information on obtaining the Twitter Event ID. |
Track
You can use the track call to capture user events and send them as conversion events for a single Universal Website Tag pixel ID.
The following snippet highlights a sample track call:
rudderanalytics.track("Product Purchased", {
"quantity": "3",
"currency": "USD",
"value": 251,
"email": "alex@example.com",
"conversionId": "56342424234"
"description": "Shoes",
"contents": [{
"id": "1",
"price": "50.00",
"quantity": 1
},
{
"id": "2",
"price": "100.55",
"quantity": 2
}
]
})Supported mappings
The following table details the mappings between RudderStack and X Ads properties:
| RudderStack property | X Ads property | Data type |
|---|---|---|
properties.eventId | event_id | String |
properties.conversionTime | conversion_time | Datetime in ISO 8601 format. |
properties.quantityproperties.numberItems | number_items | String |
properties.currency | price_currency | String |
properties.valueproperties.priceproperties.revenue | value | String |
properties.conversionId | conversion_id | String |
properties.description | description | String |
properties.contents | contents | Object |
properties.pixelId | NA | String |
Note that each event must contain at least one of the following identifier fields:
| RudderStack property | X Ads property | Data type |
|---|---|---|
properties.email | identifiers.hashed_email | String |
properties.phone | identifiers.hashed_phone_number | String |
properties.twclid | identifiers.twclid | String |
properties.ip_address | identifiers.ip_address | String |
properties.user_agent | identifiers.user_agent | String |
Note that:
- If you want to send the
ip_addressfield in your events, you must also include at least one of the other identifier fields (phone,twclid, oruser_agent).- If you want to send the
user_agentfield in your events, you must also include at least one of the other identifier fields (phone,twclid, orip_address).
The following table lists the mappings between the properties.contents object fields and X Ads properties:
properties.contents field | X Ads property | Data type |
|---|---|---|
id | content_id | String |
groupId | content_group_id | String |
name | content_name | String |
price | content_price | String |
type | content_type | String |
quantity | num_items | String |
FAQ
Where can I find the X Ads Pixel ID and Event ID?
- Sign in to your X Ads account.
- Go to Tools > Event Manager.
- Set up your X pixel and add the associated events. For more information, see Conversion tracking for websites.
- You can find the pixel ID and event ID under your pixel name and created events.
