# Twitter Pixel Destination

## About this integration

Twitter Ads helps you promote your content and expand your reach through promoted accounts and tweets. The new Twitter Pixel integration combines the legacy Universal Web Tag and Single Event Tags solutions into one, easier-to-use solution.

[Mode How we forward source data to the destination: through Customer.io's servers or directly from our JavaScript client.](/cdp/destinations/getting-started/#connection-mode)

[Web sources Indicates whether or not this integration supports our the JavaScript client.](/cdp/sources/getting-started/#types-of-sources)

[API sources Indicates whether or not this integration supports our server libraries (Go, NodeJS, Python), API, Mobile SDK, and other data sources.](/cdp/sources/getting-started/#types-of-sources)

[Supported calls The API methods this integration supports.](/cdp/sources/source-spec/source-events/)

[Integration name The name of this integration if you want to enable or disable it in the `integrations` object.](/cdp/sources/source-spec/common-fields/#the-integrations-object)

Web

[identify](/api/cdp/#operation/identify), [page](/api/cdp/#operation/page), and [track](/api/cdp/#operation/track)

twitter-pixel

## Getting started[](#getting-started)

1.  Go to **[Data & Integrations > Integrations](https://fly.customer.io/workspaces/last/journeys/integrations/all/directory)** and select the **Twitter Pixel** entry in the *Directory* tab.
    
2.  (Optional) Select the data sources that you want to connect to your outbound integration. You can always connect data sources later. We’ll only show you data sources that work with your integration.
    
3.  Configure your integration.
    
    1.  **Pixel ID**: The Pixel ID is a unique identifier for your Twitter Pixel installation. It can be found in the "Tools" -> "Events Manager" section of your [Twitter Ads](https://ads.twitter.com) account.
        
    2.  **Restricted Data Use**: The Restricted Data Use (RDU) parameter enables an advertiser to limit Twitter's use of certain data for specific business purposes only on that advertiser's behalf. More information is available [in the documentation](https://business.twitter.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites/restricted-data-use-guide.html).
        
4.  Click **Enable Destination**.
    

When you’re done, you’ll need to go to the *Actions* tab and add actionsThe source event and data that triggers an API call to your destination. For example, an incoming `identify` event from your sources *adds or updates a person* in our Customer.io Journeys destination. for each event you want to report to Twitter Pixel.

### If you’re migrating from Segment[](#if-youre-migrating-from-segment)

You’ll notice that our destination has fewer settings than Segment’s. We’ve moved some settings into our *Actions*, where we think they make more sense. We use Twitter’s current Pixel paradigm. We do not support the legacy *Universal Website Tag* and *Single Event Website Tags* web tags.

This means that you must define the events you want to send to Twitter *in your Twitter Ads account* before you map source data to those events in Customer.io. Twitter generates an event ID for each type of event you want to track, and uses that ID to group and categorize events rather than the simple event name that you send with `track` calls. You’ll need to provide this ID with each action you set up, so that we can properly map source data to events in your Twitter Ads account.

If you previously used the *Universal Website Tag*, Twitter has effectively migrated you to *Single Event Website Tags*. You’ll find the *Website Tag* for each of your events in your *Twitter Pixel Events Manager.* You’ll use this tag when you set up actions in Customer.io.

## Actions[](#actions)

By default, *Identify User* is the only enabled action. You’ll need to add actions for each event you want to report to Twitter Pixel. We support a number of default Twitter Pixel events, but you can also add custom actions for any events you’ve set up in Twitter Pixel.

When you’re done setting things up, you can go to the *Actions* tab to see how we map incoming data to your integration.

You may need to add actions for this integration

While we often have default triggers for actions, we don't always add those actions as defaults. You may need to add actions to make sure that you're sending all the data that you want to send to your integration. See our [actions](/integrations/data-out/actions/) page for help setting up actions.

Action

Default Trigger

Description

Identify User

`type = “identify”`

Send user data to Twitter Pixel

Track Page View

`type = “page”`

Track the current page

Track Custom Event

`type = “track”` and  
`event != “Products Searched”` and  
`event != “Product Viewed”` and  
`event != “Product Added”` and  
`event != “Order Completed”` and  
`event != “Product Added To Wishlist”` and  
`event != “Checkout Started”` and  
`event != “Payment Info Entered”`

Track a custom conversion event

Track Checkout Started Event

`type = “track”` and  
`event = “Checkout Started”`

Track the Checkout Started event which maps to the `InitiateCheckout` event to Twitter.

Track Order Completed Event

`type = “track”` and  
`event = “Order Completed”`

Track the Order Completed event which maps to the `Purchase` event to Twitter.

Track Payment Info Entered Event

`type = “track”` and  
`event = “Payment Info Entered”`

Track the Payment Info Entered event which maps to the `AddPaymentInfo` event to Twitter.

Track Product Added Event

`type = “track”` and  
`event = “Product Added”`

Track the Product Added event which maps to the `AddToCart` event to Twitter.

Track Product Added To Wishlist Event

`type = “track”` and  
`event = “Product Added To Wishlist”`

Track the Product Added To Wishlist event which maps to the `AddToWishlist` event to Twitter.

Track Products Searched Event

`type = “track”` and  
`event = “Products Searched”`

Track the Products Searched event which maps to the `Search` event to Twitter.

Track Product Viewed Event

`type = “track”` and  
`event = “Product Viewed”`

Track the Product Viewed event which maps to the `ViewContent` event to Twitter.

### Predefined Track Events[](#predefined-track-events)

We’ve defined a number of ecommerce events for Twitter Pixel based on our own ecommerce specification. If you use our ecommerce specification for other things, you’ll likely want to use these events as well to track conversions in Twitter. These events are all triggered by common event names defined in our ecommerce specification.

For all other events, you’ll want to use the *Custom Event Action* and set your own trigger based on the *Track Event Name*. By default, our *Custom Event* action excludes all of our predefined events, but you may want to set the trigger to simply match on the event name that you send from your sources. Remember: for each event you want to send to Twitter, you need to define it in your Twitter Ads account first.

### Set up a Twitter Pixel action[](#set-up-a-twitter-pixel-action)

Before you set up a new action, make sure that you’ve defined your event in Twitter Pixel. See [Twitter’s Documentation](https://business.twitter.com/en/help/campaign-measurement-and-analytics/conversion-tracking-for-websites.html) for help setting up new events. When you set up events, you’ll need to get the *Website Tag* for this event. We don’t expect you to store this pixel in your sources. Rather, you set it up in Customer.io and we’ll automatically append it to data that we send to your destination.

1.  In your Twitter Pixel destination, go to the *Actions* tab and click **Add Action**.
2.  Set your *Trigger* conditions. In general, you’ll use *Track Event Name* to determine when we’ll send event data to Twitter.
    
     For custom events, you should set an *is* condition
    
    When you set up a custom event, we assume that you’ll look for any event that *is not* one of our presets. However, with Twitter, you may simply want to set conditions to *Track Event Name `is` event-you-want-to-track>*. With twitter, it’s unlikely that you’ll have a “catch-all” event, because you need to define your events in Twitter first.
    
    [![the list of event names we omit on a custom event](https://docs.customer.io/images/cdp-twitter-pixel-action-trigger.png)](#c144990cf07d77781426e880b9832b63-lightbox)
    
3.  Under *Data Structure*, set your *Event ID*: this is the *Website Tag* for the event you defined in Twitter Pixel.
    
    [![set the pixel ID for this specific event](https://docs.customer.io/images/cdp-twitter-pixel-action-id.png)](#cdbcf7eff31d08ac86dc0a99e2a03a5a-lightbox)
    
4.  In the next field down, you can set the *Conversion ID*. In general, we use the `messageId` from incoming source events, because it deduplicates source data and ensures that we report unique conversions to Twitter.
5.  Set the *Click ID* if you want to force conversions to a particular click—like the *Add to cart* button for `added_to_cart` events, or something similar. If you don’t set a click target, Twitter will provide the Click ID itself.
6.  Determine the fields that you want to pass to Twitter. You can send all `$.properties`, or you can select individual event properties. You can also map specific fields for *Currency* and *Revenue*.
    
    [![add the fields you want to pass to Twitter](https://docs.customer.io/images/cdp-twitter-pixel-action-fields.png)](#a05f18a4a45761faedb60eab925684fd-lightbox)
    
7.  Click **Save Action**.

### Sending product information to Twitter[](#sending-product-information-to-twitter)

In general, when you send events containing product information, Twitter expects you to identify products by SKU. But they’ll also support an ID if you don’t have the product SKU. So, when you send an event that contains `properties.products`, we’ll automatically identify products by SKU if it exists or ID if the SKU does not exist.

You can change this mapping by editing the array of products, but, if you do this, you’ll also want to define the other product keys that you want to pass along to Twitter.