📘

This integration is currently in beta. Contact your MetaRouter support team to get started.

What Is X Ads?

X Ads is a digital advertising platform that allows businesses and individuals to promote their tweets, accounts, and trends to a broad audience. Advertisers can target users based on various factors such as demographics, interests, keywords, and behaviors, ensuring their messages reach the most relevant audience. The platform offers different ad formats, including promoted tweets, promoted accounts, and promoted trends, each designed to engage users in unique ways. Additionally, X Ads provides analytics and insights to help advertisers measure the performance and effectiveness of their campaigns.

X Ads - Web Conversions is a server-side integration that allows advertisers to directly send web conversion events from their servers to X Ads. This integration allows for accurately tracking and measuring the effectiveness of ad campaigns by capturing conversions, such as purchases, sign-ups, or other valuable actions, that occur in web environments. By using the X Ads Conversions API, advertisers can ensure more reliable data collection, better attribution, and enhanced optimization for their campaigns, particularly in environments where traditional tracking methods, like cookies, may be limited or less effective.

What are the benefits of integrating MetaRouter with Twitter (X) Ads?

  • Enhanced Data Accuracy: MetaRouter's server-side integration ensures precise and reliable event data delivery to Twitter Ads, reducing discrepancies often seen with client-side tagging.
  • Improved Site Performance: Eliminating the need for a Twitter Ads tag on the site decreases page load times and enhances overall site performance by reducing client-side script execution.
  • Simplified Data Management: Centralizing event and parameter delivery through MetaRouter streamlines data management, making it easier to maintain and update marketing and advertising configurations.

Capabilities and Considerations

  • Conversion tracking and optimization: Accurately track conversions like purchases and other key actions by sending conversion data directly from the server.
  • Advanced targeting: Custom audiences are available, as user identifiers (e.g., click ID, hashed emails, and phone numbers) are sent to X Ads using the Conversions API. This ensures that audience segmentation and retargeting can be achieved without relying on client-side data collection methods.
  • Real-time analytics and reporting: You can still access real-time analytics on conversion events sent via the integration, and these will be reflected in the X Ads Manager’s conversion reports as well as Events Manager.
  • Enriched Audience Insights: X Ads uses the data captured from conversions and ad interactions to compile audience insights such as demographics (age, gender, location) and behaviors (interests, activities). While this integration does not directly pass demographic data, it enables X to combine the server-side conversion events with the demographic and behavioral data already associated with the users in its ecosystem. This allows advertisers to continue optimizing campaigns based on audience insights when using server-side tracking.
  • Flexible bid and budget control: Conversion events tracked through the API can still be used for optimizing bidding strategies, such as CPA (Cost Per Action) optimization, within the X Ads platform.
  • Access Level Consideration: When planning your integration, determine your API Access Level based on the estimated number of event POST requests per month. The free version of the API supports up to 1,500 POST requests per month. For more details, refer to the X Ads API - API Access Levels.

Limitations

  • Granularity of User Interactions: While server-side tracking captures key events such as page visits and conversions, capturing highly detailed metrics like scroll depth or time spent on page can be more complex. These metrics require a deeper level of real-time user interaction data that may not be fully addressed by server-side methods.
  • Impression Tracking and CTR Calculation: The server-side integration may not capture impression data, which is necessary for calculating metrics like Click-Through Rate (CTR).
  • Web Conversions Only: This server-side integration is designed to track and report web conversions exclusively. It does not support conversions from mobile apps, meaning app-based user interactions and conversions are not captured through this method. To track app conversions, a separate integration using app-specific tracking methods is required. Please reach out to your MetaRouter customer team for support if you need to track app events.

Getting Started - From Your X Account

  • Create a Developer Account:

    • If you don’t already have a X developer account, sign up at X Developer Portal.
    • Complete the registration and app creation process.
  • Create an X Ads Project and App:

    • Once your developer account is active, navigate to the Projects & Apps section in your X Developer Portal.
    • Create a new app by following the setup process.
    • Determine your Access Level based on the number of event POST requests you expect to send per month. For more details, refer to the X Ads API - API Access Levels
      • Note: The free version of the API supports a maximum of 1,500 POST requests per month.
  • Get the Consumer Key and Consumer Secret:

    • After creating the app, go to the Overview tab under Projects & Apps, and click on the key icon.
    • Under "Consumer Keys", you will find the Consumer Key (API Key) and Consumer Secret (API Secret Key).
    • Copy these and store them securely as you will need them for the integration.
  • Generate Access Token and Token Secret:

    • Scroll down to the "Authentication Tokens" section.
    • Click on "Generate" to create the Access Token and Token Secret.
    • Copy both the Access Token and Token Secret for use in the integration.
  • Obtain the Pixel ID:

    • In your X Ads Manager, navigate to the Tools section and then click on Events Manager.
    • Find the pixel that you are using for conversion tracking.
    • Copy the Pixel ID associated with that pixel.
  • Set the API Version:

    • For the API_VERSION, use the current version of the X Ads API you’re working with. As per the example in the file, this could be '12', but verify the latest version in the X Ads API documentation.
  • Locating Event IDs:

    • To ensure conversions are tracked correctly, you must assign an Event ID to each event in the playbook. You can find these Event IDs by going to X Ads Manager > Tools > Events Manager. The Event ID for each event is displayed just below the event's title.


Getting Started - From Your MetaRouter Account

Adding an X Ads - Web Conversions integration.

From the integration library, add an X Ads- Web Conversions integration. Then, fill out the Connection Parameters:

Connection Parameter NameDescription
API_VERSIONThe version of the X Ads API you are using (e.g., "12").
PIXEL_IDThe unique identifier for your X Ads pixel.
CONSUMER_KEYThe API key from your X Ads developer account.
CONSUMER_SECRETThe API secret key from your X Ads developer account.
ACCESS_TOKENThe OAuth token that grants access to X Ads APIs.
TOKEN_SECRETThe OAuth token secret used in combination with the access token.

Adding an X Ads Sync

To gather the twclid value, you must add an X Ads sync.

  1. From the Pipelines page, find the pipeline associated with the web property you’d like to add a sync to. Hover over the three dot dropdown and select “Build AJS File.”
  2. In the Identity Syncs section, select the X Ads sync.
  3. Fill out the following fields:
    1. Consent Type
    2. Cookie Lifetime (in days) - 30 days default
  4. Scroll down and click the Save and Build File button.
  5. Deploy your AJS file to propagate changes to your web property.

Event Mappings

MetaRouter provides all of the event mappings that X Ads Conversions API integrations typically require. You may add custom events, parameters or mappings in accordance with X Ads’ API documentation.

Global

Global mappings will be applied to all events. If your parameter names do not match the Expected Inputs provided, you will need to overwrite the Inputs provided with your own.

Output KeyDescriptionExpected Input
conversion_id
Required
String: A unique identifier for each conversion event.messageId
conversion_time
Required
Timestamp: The time the conversion event occurred.timestamp
identifiers
Required
Object: Contains hashed identifiers (email, phone, twclid, etc.).N/A - Expression
number_itemsInteger: The number of items involved in the conversion.N/A - Expression
price_currency
Required
String: The currency of the conversion value (e.g., USD).N/A - Expression
value
Required
Float: The total value of the conversion (e.g., total order amount).N/A - Expression
descriptionString: A description of the event type (e.g., product purchase or page view).N/A - Expression
contentsArray: List of contents involved in the conversion (e.g., SKU, name, price, quantity).N/A - Expression

Event Specific

Note: To ensure conversions are tracked correctly, you must assign an Event ID to each event in the playbook. Please see the steps above on how to locate Event IDs in X Ads Manager.

Page

Output KeyDescriptionExpected Input
event_idString: A unique event identifier.Enrichment - ADD_EVENT_ID_HERE

Product Added

Output KeyDescriptionExpected Input
event_idString: A unique event identifier.Enrichment - ADD_EVENT_ID_HERE

Product Viewed

Output KeyDescriptionExpected Input
event_idString: A unique event identifier.Enrichment - ADD_EVENT_ID_HERE

Order Completed

Output KeyDescriptionExpected Input
event_idString: A unique event identifier.Enrichment - ADD_EVENT_ID_HERE

Checkout Started

Output KeyDescriptionExpected Input
event_idString: A unique event identifier.Enrichment - ADD_EVENT_ID_HERE

Products Searched

Output KeyDescriptionExpected Input
event_idString: A unique event identifier.Enrichment - ADD_EVENT_ID_HERE
search_stringString: The search string used for the event.properties.query

Payment Info Entered

Output KeyDescriptionExpected Input
event_idString: A unique event identifier.Enrichment - ADD_EVENT_ID_HERE

Product Added to Wishlist

Output KeyDescriptionExpected Input
event_idString: A unique event identifier.Enrichment - ADD_EVENT_ID_HERE

Default

Output KeyDescriptionExpected Input
event_idString: A unique event identifier to track each specific conversion event. A catch-all event refers to an event ID that is used when there are multiple types of events being tracked, and you need a single identifier for all those events. In the context of X Ads, this is typically used when tracking broad categories of events where specific event types might not be predefined.Enrichment - ADD_CATCH_ALL_EVENT_ID_HERE

Required & Recommended Identifiers

These identifiers must be mapped to X Ads in order for successful user matching to occur. Without these IDs, any events sent to X Ads may not be accurately reflected in reporting. For your convenience, required and recommended IDs are mapped as Global parameters to ensure they are added to every event.

X Ads currently needs at least one identifier to be passed such as Click ID (twclid), email address, or phone number. If using IP address or user agent, a second identifier must be sent for proper conversion matching.

Passing more identifiers will yield a higher conversion matching rate.

AttributeExampleSync Injector Required?
twclid
Recommended
?twclid=12345abcdeYes
hashed_email
Recommended
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855No
hashed_phone_number
Recommended
a3dcb4d229de6fde0db5686dee47145dNo
ip_address
Recommended
192.168.1.1No
user_agent
Recommended
Mozilla/5.0 (Macintosh; Intel Mac OS X)No

Additional X Ads Conversion API Documentation