X Ads (formerly Twitter Ads)

Send your event data from RudderStack to X Ads.

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.

Get started

RudderStack supports sending event data to X Ads via the following connection modes:

Connection ModeWebMobileServer
Device mode---
Cloud modeSupportedSupportedSupported

Once you have confirmed that the platform supports sending events to X Ads, follow these steps:

  1. From your RudderStack dashboard, add a source. Then, from the list of destinations, select X Ads.
  2. Assign a name to the destination and click Continue.

Account settings

  1. Click the Create Account button.
  2. Under Choose an account, click the Connect with X Ads button and give RudderStack the required permissions to access your account. Then, click Save.
  3. To verify or change your account, click the Edit Credentials button.
X Ads account settings

Connection settings

  • Pixel ID: Enter the Universal Website Tag (UWT) ID for your X Ads account.
  • Map RudderStack event name to X event ID: This setting lets you map a RudderStack Event Name to a specific Twitter Event ID.
info
For more information on obtaining the Pixel ID and Twitter Event ID, see FAQ.

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 propertyX Ads propertyData type
properties.eventIdevent_idString
properties.conversionTimeconversion_timeDatetime in ISO 8601 format.
properties.quantity
properties.numberItems
number_itemsString
properties.currencyprice_currencyString
properties.value
properties.price
properties.revenue
valueString
properties.conversionIdconversion_idString
properties.descriptiondescriptionString
properties.contentscontentsObject
properties.pixelIdNAString

Note that each event must contain one of the following fields:

RudderStack propertyX Ads propertyData type
properties.emailidentifiers.hashed_emailString
properties.phoneidentifiers.hashed_phone_numberString
properties.twclididentifiers.twclidString

The following table lists the mappings between the properties.contents object fields and X Ads properties:

properties.contents fieldX Ads propertyData type
idcontent_idString
groupIdcontent_group_idString
namecontent_nameString
pricecontent_priceString
typecontent_typeString
quantitynum_itemsString

FAQ

Where can I find the X Ads Pixel ID and Event ID?

  1. Sign in to your X Ads account.
  2. Go to Tools > Event Manager.
  3. Set up your X pixel and add the associated events. For more information, see Conversion tracking for websites.
  4. You can find the pixel ID and event ID under your pixel name and created events.
X Ads pixel ID and event ID

Questions? Contact us by email or on Slack