About conversion tracking
Overview
Conversion tracking enables you to measure your return on ad spend by tracking the actions people take after viewing or engaging with your ads on X.
On X, you can use our X Pixel or the Conversions API to set up conversion tracking. These solutions pass data back to X and help enable user attribution. It does this by matching conversion data to an X user, using available identifiers like cookie IDs, Click ID or email. The X Pixel allows advertisers to put a piece of code on the website to send conversion data to X. The Conversion API allows advertisers to send conversion data directly from a server to X.
Learn more about the X Pixel, Conversions API, and other conversion tracking tools here.
Attributed data can be used for a variety of purposes, such as building Website Activity Audiences for campaign retargeting, to improve optimization models to help you drive action with your campaigns, and for reporting of campaign results, to understand the impact of a campaign.
Use of any of X's conversion tracking products or services is subject to the X Conversion Tracking Program T&C’s, which can be found here.
How the X Pixel uses cookies
A cookie is a small text file that a webpage instructs a user's internet browser to store and helps the webpage remember information about the user’s visit, which can be used to make subsequent visits more useful (e.g. remembering a language preference), but also to understand how the user interacts with the webpage.
You are able to use both first-party and third-party cookies with the X Pixel. First-party cookies are owned by the domain the user is visiting. Third-party cookies are owned by a domain other than the domain the user is currently visiting.
Third-party cookies are no longer supported by many browsers and are declining in usage. By using first-party cookies with the X Pixel, X is able to match and attribute more conversions than with third-party cookies. This allows you to better understand the impact of your advertising campaigns as well as better optimize your campaigns.
Visit this page to learn more about our cookie policy and how they are used.
Advertiser consideration
Please note: X cannot provide guidance regarding compliance with any law, and the following does not constitute legal advice. We strongly recommend you consult with your legal team to evaluate all applicable requirements, including those pertaining to notice and consent.
Legal obligations regarding the collection and sharing of personal data are rapidly evolving around the globe. It’s important you understand your obligations before you use cookies or similar technologies, including any of X’s conversion tracking products. Below is some general context and links to useful resources to help you understand certain requirements regarding the use of cookies and similar technologies.
Cookie requirements and guidance
Europe’s ePrivacy Directive contains various requirements regarding the use of cookies and similar technologies, including:
Consent. You must obtain an individual’s consent before setting or reading cookies or similar technologies that are not strictly necessary or otherwise exempt from the consent requirement. While requirements may vary by region, generally for consent to be valid it must be:
Freely given - An individual must have genuine choice and control over how you use their data. This means the individual must be able to refuse to give consent without detriment, and must be able to withdraw consent easily at any time. It also means consent should be unbundled from other terms and conditions - including giving separate granular consent options for different types of processing - wherever possible.
Specific and informed - You must explain who is using the cookies and similar technologies, the purposes for which such technologies are being used, and that the individual has the right to easily withdraw consent at any time.
Unambiguous and affirmative - It must be obvious that the individual has consented through clear, deliberate, and specific action to opt in or otherwise agree to the processing, and what they have consented to.
You should carefully evaluate how you obtain consent for your use of cookies and similar technologies to ensure that you meet the requirements under all applicable law.
Clear and Comprehensive Information. You must provide individuals with “clear and comprehensive information” about the use of cookies and similar technologies on your website or app in accordance with applicable data protection law. This information should be provided to individuals upfront, with easily readable, conspicuous links to additional information about the use of cookies and similar technologies and other data processing activities (such as your privacy or cookie notices). Information you should provide to individuals upfront in plain, user-friendly language includes, without limitation:
The specific purposes for which cookies and similar technologies are used on your website or app and their duration, including any technologies you use from third parties such as X.
How individuals can reject non-essential cookies and similar technologies or subsequently withdraw their consent.
Granular controls for non-essential cookies and similar technologies, where appropriate.
Remember that how you request consent and present all requisite information to users is important - you should provide clear and comprehensive information without confusing individuals or unduly disrupting the user experience.
How to disable cookies and other controls
It should be clear and simple for users to withdraw consent after they’ve provided it, should they choose to do so. Generally, it’s recommended that you:
Provide your own control that disables the setting or reading of any cookies that are not strictly necessary, including advertising-related cookies.
For third-party plugins or pixels, provide access to choice mechanisms those third parties provide, if any. Specifically, if you participate in X's Conversion Tracking Program or Custom Audiences Program, you must provide your users with legally sufficient instructions regarding how to opt out of X's interest-based advertising, including through an applicable opt-out mechanism specified by X.
Determine whether you need to make any adjustments to your external disclosures and user consent processes in order to account for your use of X's conversion tracking products. Again, we strongly recommend you consult with legal counsel to understand your legal obligations based on your specific use of cookies and similar technologies. The usage of X's conversion tracking solutions is contingent on your continued compliance with all applicable terms and conditions, including but not limited to X’s Policies for Conversion Tracking and Custom Audiences.
DPA Guidance
Data Protection Authorities in Europe often issue their own guidance that provide detailed information regarding how to comply with the law, including the ePrivacy Directive and national regulations. Some examples include:
- Ireland - IDPC Guidance Note: Cookies and Other Tracking Technologies
- France - CNIL Cookie Guidance
- Germany - Guidance for Providers of Telemedia Services
- Spain - AEPD Guide Regarding the Use of Cookies
- UK - ICO Guidance on the Use of Cookies and Similar Technologies
The list above is not exhaustive, and these resources may be updated or replaced from time to time. We strongly recommend that you obtain advice from your legal team and contact your local Data Protection Authority for the most up-to-date information regarding your compliance obligations related to the use of cookies and similar technologies.
Sensitive Data
X does not allow you to create sensitive conversion events or custom audiences using X's advertising products, as stipulated in X’s Policies for Conversion Tracking and Custom Audiences. If sensitive data is included in a website URL, you can disable the inclusion of the website URL by placing a ‘set’ command before the ‘init’ or ‘config’, and setting the pixel parameter hide_page_location value to true.
Example code:
twq(‘set’, { hide_page_location: true });
twq(‘config’, ...); or twq(‘init’, ...);
Advertiser control
First-party cookie usage by the X Pixel can be managed within the X Events Manager. Use the X Pixel settings to enable or disable the use of first-party cookies. If first-party cookies are disabled, only third-party cookies will be used.
We use first-party cookies to expand our Click ID functionality. Click ID is a unique identifier that is automatically appended in the URL to help improve our ability to attribute site actions.
Specifically, Click ID enables measurement of conversion events beyond landing page visits by introducing the availability of first-party cookies. This first party cookie will store the Click ID parameter appended to your landing page URL in order to measure the conversion events that take place on your website. This option is default on.
To access these settings,
Navigate to Events Manager
Click on ‘X Pixel’ on the left side of the navigation
Click on “Settings”
Use the “Allow first party cookies” box to enable or disable first-party cookie usage
Our recommendation is to control X Pixel usage on your website using consent management tools or tag managers. These platforms offer various ways to enable or disable the loading of pixels on your website.
Note: related to Click ID, if you are using a "Content-Security-Policy" (CSP) header on your website, ensure that you're allowlisting "ads-twitter.com", "ads-api.twitter.com", and "analytics.twitter.com" in "img-src" and "connect-src" directives in order to continue to see results with the X Pixel.
Restricted data use
X’s Restricted Data Use (“RDU”) feature enables an advertiser to limit X’s use of individual-level conversion events for specific business purposes only on that advertiser’s behalf.
To enable RDU, an advertiser must send X a parameter to indicate the advertiser would like X to limit its use of conversion data received for an individual conversion event. When enabled, X will limit the use of personal data received in connection with the restricted conversion event to certain business purposes on behalf of the advertiser, such as measurement.
Advertisers must decide for themselves when and how to leverage RDU - for example, an advertiser may want to apply the RDU parameter on a per-user basis based on an opt-out signal, or more broadly based on user location in regions where certain laws apply. As applying the RDU parameter may result in a negative impact to campaign reach, effectiveness and overall performance, advertisers should use caution when determining when and how to apply the parameter.
If you are interested in leveraging the RDU feature, reach out via this form, select the “Mobile App, Conversion Tracking & Audience Manager” category, and then select “How to set up Restricted Data Use”.
X Pixel implementation best practices
Ensure the right X Pixel code is placed on your website. It’s important to add the full JavaScript pixel code as provided in Events Manager, ensuring the right IDs are included.
Place your X Pixel code in the header, just before the closing of the </head> tag.
Do not include your X Pixel code in an iFrame or other existing tags. This can result in reduced measurement capability for your X Pixel. For example, including your X Pixel in other tags, may result in the X Pixel firing from another domain, preventing the ability to use first-party cookies.
Verify that your event is implemented correctly by using the X Pixel Helper, as well as checking the event status in Events Manager.
Edit the X Pixel code if you’d like to dynamically pass additional information related to your conversion events. For example, you can use the parameter ‘value’ to pass a value of the conversion. More info about parameters here.
Specifications of X cookies used for attribution
1P cookie
Host Domain: advertiser domain
Cookie name: _twclid
Duration: 30 days, from the first day the X click id was stored in it
Type: 1st party
Function: Advertising cookie
3P cookies
Host Domain: t.co
Cookie name: muc_ads
Duration: 2 years
Type: 3rd party
Function: Advertising cookie
Host Domain: analytics.X.com
Cookie name: auth_token
Duration: 5 years
Type: 3rd party
Function: X login cookie
Host Domain: analytics.X.com
Cookie name: personalization_id
Duration: 2 years
Type: 3rd party
Function: Advertising cookie