- X Pixel or Conversion API?
- The two parts of the pixel
- How to create the X Pixel
- Installing the code
- Events and parameters you can track
- Running pixel and Conversion API together
- How to check your pixel is working
- Retargeting with the same pixel
- If the pixel won't fire
- Privacy controls
- My verdict
- Frequently asked questions
The Twitter pixel, now the X Pixel, is a tag you add to your website so X can track what people do after seeing or clicking your ads, such as purchases or sign-ups. You create it in X Ads under Tools, then Events Manager, add the base code to every page and add event code where actions happen. X recommends the pixel for most advertisers, with its Conversion API as the server-side alternative.
Without it, X can tell you who clicked an ad but not who bought. Here's the setup from X's own business help page, plus the checks that save you from a campaign optimising on missing data.
X Pixel or Conversion API?
| Option | How it works | Best for |
|---|---|---|
| X Pixel | A website tag that tracks actions in the visitor's browser | Most advertisers; X calls it the most straightforward to set up |
| Conversion API | A direct server-to-server connection, no website code | Sites that can't run JavaScript, or teams with server-side tracking |
X says both do largely the same job and you need at least one to get the most from web campaigns. If you're unsure what server-to-server means, my explainer on APIs and webhooks covers the basics.
The two parts of the pixel
- Base code goes on every page of your site. It tracks visits and starts the pixel, and once it's live X automatically creates Site Visit and Landing Page View events.
- Event code goes where specific actions happen, such as an add-to-cart button or a thank-you page. It needs the base code to work.
How to create the X Pixel
- Log in to your ads account at ads.x.com.
- Under Tools, choose Events Manager. No Tools tab? X says that's usually because there's no card on the ads account yet.
- Click Add event source and agree to X's terms. Your base pixel is created, with Site Visit and Landing Page View events.
- Click Add events, name the event, choose its type, set the attribution window and, if you like, switch on Website activity audience. Click Create Event.
- Pick how to install it: directly in your site code, through a supported tag manager such as Google Tag Manager, or by Conversion API.
- Repeat for each action you want to track.
Installing the code
In Events Manager, open View Twitter pixel, copy the pixel code and paste it before the closing head tag on every page. Then, for each event, click View install code and add that code to the right element or page. If more than one ads account tracks the same site, X shows how to bundle their codes in one script.
Events and parameters you can track
| Event type | Typical use |
|---|---|
| Page view | A key page such as pricing |
| Add to cart | Shop baskets |
| Lead | Form fills and enquiries |
| Added payment info | Checkout progress |
| Purchase | Completed orders, with value and currency |
| Custom | Anything else you define |
Parameters add detail to each event, such as the order value, the currency, a search string or the products bought. X's tip: use each conversion type, such as Purchase, only once on your site, because duplicates split the signal and weaken optimisation. Parameters only work on events defined with code, not on events defined by URL rules.
Running pixel and Conversion API together
If you send the same events both ways, X strongly recommends a deduplication key: pass a conversion_id parameter in both the pixel and the API request so a sale isn't counted twice. You can also send email addresses and phone numbers; X says the pixel hashes them automatically with SHA256 so no unhashed data is shared.
How to check your pixel is working
Go back to Events Manager. Each event shows one of three statuses:
| Status | What it means |
|---|---|
| Active | Activity detected in the last 24 hours |
| No recent activity | Nothing detected in the last 24 hours |
| Inactive | No activity detected |
For a closer look, hover over the three dots next to an event and choose View Activity. The Recent Activity Log shows a sample of events from the past few hours, with the time, the parameters sent and the website that sent them. X also offers the X Pixel Helper, a Chrome extension that shows the pixel's status and error codes.
Retargeting with the same pixel
The pixel does a second job: Website Activity Audiences. X says these let you reach people on X who recently visited your website, using the same X Pixel you installed for conversion tracking, so there's nothing extra to add. Switch on Website activity audience when you create an event, and you can later show ads to people who viewed a product, started a checkout or read your pricing page.
Want AI doing the heavy lifting in your marketing?
I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.
If the pixel won't fire
- Check the base code is on every page, before the closing head tag, not just the landing page.
- Confirm the event code sits on the page or button where the action completes, such as the order confirmation page.
- If your site uses a content security policy, X notes that its tags at platform.twitter.com redirect to static.ads-twitter.com, so allow that domain.
- Remember the pixel only starts sending data the first time someone visits a tagged page.
Privacy controls
X's Restricted Data Use parameter lets you limit how X uses certain data, for example for visitors who have opted out or in regions where specific laws apply. Check it with whoever handles your cookie consent before you go live.
My verdict
Install the X Pixel before you spend anything on X ads, add one Purchase or Lead event, and confirm it shows Active in Events Manager after a test visit. That alone tells you whether X sends buyers or browsers. Then judge X against your other channels on cost per sale, not clicks; my guide to measuring social media ROI shows how.
Frequently asked questions
Is the Twitter pixel the same as the X Pixel?
Yes. X's help pages call it the X Pixel, though some screens in Events Manager still say View Twitter pixel.
Where do I find the X Pixel?
Log in at ads.x.com, open Tools, then Events Manager. If there's no Tools tab, add a card to the ads account first.
Do I need the X Pixel or the Conversion API?
At least one. X recommends the pixel for most advertisers and the Conversion API for sites that can't run JavaScript or prefer server-to-server tracking.
How do I know my X Pixel is working?
Check the event status in Events Manager: Active means activity in the last 24 hours. Use View Activity or the X Pixel Helper Chrome extension for detail.


