> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runconverge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# X Ads (Twitter Ads)

> An introduction to the X Ads (Twitter Ads) Destination

export const OutboundLink = ({linkText, linkTarget}) => {
  return <a target="_blank" href={linkTarget}> {linkText} 
    <div className="inline h-3 w-3 fill-gray-500 dark:fill-gray-100 text-gray-500 dark:text-gray-300 ml-1 mr-1">
      <svg className="inline w-2.5 h-2.5 bg-gray-500 dark:bg-gray-300" style={{
    maskImage: `url('https://mintlify.b-cdn.net/v6.5.1/solid/up-right-from-square.svg')`,
    maskRepeat: "no-repeat",
    maskPosition: "center center"
  }}></svg> 
    </div>
    </a>;
};

export const IconText = ({name, text, iconSource = "mintlify", iconLocation = "before", iconType = "solid"}) => {
  const sourceUrl = iconSource === 'local' ? `url('/images/icons/${name}.svg')` : `url('https://mintlify.b-cdn.net/v6.5.1/${iconType}/${name}.svg')`;
  return <>
            <div className="inline-block pl-2">
                {iconLocation === 'before' && <div className="h-3.5 w-3.5 fill-gray-800 dark:fill-gray-100 text-gray-800 dark:text-gray-100 inline-block align-middle mr-2">
                        <svg className="w-4 h-4 bg-gray-800 dark:bg-gray-100 " style={{
    maskImage: sourceUrl,
    maskRepeat: "no-repeat",
    maskPosition: "center center"
  }} />
                    </div>}
                <span className="inline-block align-middle font-semibold fill-gray-800 dark:fill-gray-100 text-gray-800 dark:text-gray-100 pl-1 pr-2">{text}</span>
                {iconLocation === 'after' && <div className="h-3.5 w-3.5 fill-gray-800 dark:fill-gray-100 text-gray-800 dark:text-gray-100 inline-block align-middle mr-2">
                        <svg className="w-4 h-4 bg-gray-800 dark:bg-gray-100 pr-3" style={{
    maskImage: sourceUrl,
    maskRepeat: "no-repeat",
    maskPosition: "center center"
  }} />
                    </div>}
            </div>
        </>;
};

export const Icon = ({name}) => {
  return <div className="h-4 w-4 fill-gray-800 dark:fill-gray-100 text-gray-800 dark:text-gray-100 inline-block align-middle">
            <svg className="w-4 h-4 bg-gray-800 dark:bg-gray-100" style={{
    maskImage: `url('https://mintlify.b-cdn.net/v6.5.1/solid/${name}.svg')`,
    maskRepeat: "no-repeat",
    maskPosition: "center center"
  }} />
        </div>;
};

## Overview

Destination Type: <IconText text="Client-side" name="browser" iconType="duotone" iconLocation="after" />

* Includes support for passing <OutboundLink linkText="User Parameters (email and phone number)" linkTarget="https://business.x.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites.html" />
* Includes support for  <OutboundLink linkText="Dynamic Product Ads Campaigns" linkTarget="https://business.x.com/en/help/campaign-setup/create-a-dynamic-product-ads-campaign.html" />

***

## Installation instructions

<Note> This is a client-side-only destination, meaning that you will need to be tracking all events client-side (including `Placed Order`) for this destination to work properly. </Note>

<Steps>
  <Step icon="list" title="Set up tracking in Twitter Ads">
    1. Navigate to your X Ads account and choose **Tools > Events Manager**.

    2. Copy your X **Pixel ID**
       1. If you already have an events source, at the top of the page, find the 'X pixel' section and copy the ID. (e.g. `obarl`)
       2. If not, you will be prompted to create a new event source, follow the instructions and copy the **Pixel ID** when you are done.

    3. Go to X Ads > Tools > Events Manager and click on the **Create Event** button.

    4. Give your event a name, e.g. 'Placed Order' when you are setting up a purchase conversion.

    5. Pick a X event type, e.g. 'Purchase'. You can find a suggested mapping of Converge to X Ads event types [below](#event-mapping).

    6. Configure your attribution settings and click on **Next**.

    7. Choose the 'Define event with code' setup method and click on **Next**.

    8. Click 'Save' to finish the setup.

    9. You can now find the event in the Events table in the X Ads Events manager.
       Under the event, the ID is composed as `tw-{pixelID}-{eventID}`.
       Copy the `eventID` save it for the Converge destination configuration.

    <Note> Repeat the steps 3-9 above for all the conversions you want to track in X Ads.</Note>
  </Step>

  <Step icon="list" title="2. Set up your destination">
    10. In the Converge sidebar, click on <IconText name="arrow-right-from-line" text="Event streams" /> and then click **Create new Destination**.

    11. Select the **X Ads (Twitter Ads)** destination and click **Next**.

    12. Give your destination a **name** (e.g. X Ads Destination) and click **Next**.

    13. Fill in the **Pixel ID** you copied from **X Ads** and click **Next**.

    14. Click on <IconText name="plus" text="Add new mapping" /> and select Placed Order as the source event.

    15. In the Forward As value enter **eventID** you saved for the purchase conversion in X Ads.

    16. Select **Client** as the Forwarding Mode and click **Next**.

    <Note> Repeat the steps 14-16 above for all the conversions you track in X Ads </Note>

    <Frame>
      <img src="https://mintcdn.com/converge/crQaBntMCFTIm3T-/images/destinations/x/x-ads-custom-mapping-example.png?fit=max&auto=format&n=crQaBntMCFTIm3T-&q=85&s=c2b3103cb9fb66dd9abb17ee354905d1" alt="x-ads-4" width="1268" height="282" data-path="images/destinations/x/x-ads-custom-mapping-example.png" />
    </Frame>

    17. Select the sources you want to forward events from, then click **Next**.

    <Note>This is a client-side destination, meaning that only client-side sources can be used with this destination. You can still select server-side sources but the events will not be sent to X.</Note>

    18. Review any issues and click **Submit**.
  </Step>
</Steps>

<Warning> Once you have installed your Converge Destination, you should **pause or remove all existing X Ads tracking**. Leaving these on will lead to duplicate tracking.  </Warning>

***

## Modify your Content ID

The Converge X Ads Destination will use the **Product ID** by default.
However, you can configure the destination to use explicitly the **Variant ID** or **SKU** instead.

1. Navigate to your X Ads Destination, click on **Configuration**.
2. Click on the **Configuration**-subtab
3. Open the **Advanced configuration (optional)** section
4. Pick your desired Content ID, and click on **Save**

**List of available Content ID Modes**

| Content ID Mode | Behavior                    |
| --------------- | --------------------------- |
| Product Id      | Always use the `product_id` |
| Variant Id      | Always use the `variant_id` |
| SKU             | Always use the `sku`        |

***

## Converge functionality

This integration supports the following Converge destination functionality.

| Converge Feature                                     |       Supported       |
| ---------------------------------------------------- | :-------------------: |
| Custom Events                                        | <Icon name="xmark" /> |
| Filters                                              | <Icon name="xmark" /> |
| Server-side Conversions                              | <Icon name="xmark" /> |
| [Conversion amount](/destinations/conversion-amount) | <Icon name="check" /> |

***

## Event mapping

Events are not automatically mapped, you need to configure the mapping of the [Converge event spec](/sources/converge-spec) to your X Ads events manually.
We recommend the following mapping to the Event Type:

| Converge Event Name                                             | Twitter Event Type   |
| --------------------------------------------------------------- | -------------------- |
| [\$page\_load](/sources/converge-spec#page-load)                | `Page view`          |
| [Viewed Product](/sources/converge-spec#viewed-product)         | `Content view`       |
| [Added To Cart](/sources/converge-spec#added-to-cart)           | `Add to cart`        |
| [Started Checkout](/sources/converge-spec#started-checkout)     | `Checkout initiated` |
| [Added Payment Info](/sources/converge-spec#added-payment-info) | `Added payment info` |
| [Placed Order](/sources/converge-spec#placed-order)             | `Purchase`           |
