Twitter Tips & Strategies

How to Find a Twitter Pixel ID

By Spencer Lanoue
October 31, 2025

Lost looking for your X (formerly Twitter) pixel ID? You're not alone. Finding that specific string of numbers in your X Ads Manager can feel a little like a treasure hunt, but we promise, it's easier than you think. This guide will show you exactly where to find your conversion tracking pixel details, understand what you're looking at, and put it to work right away.

What is the X Pixel (And Why is it Called So Many Things)?

First, let's clear up some confusion. You'll see this tool called the "X Pixel," "Twitter Pixel," "Conversion Tag," or just "Event Source." They all refer to the same thing: a snippet of JavaScript code that you place on your website. This humble piece of code is the essential bridge between your marketing efforts on X and the actions people take on your site.

Think of it as your own private detective. When someone clicks your ad on X and then visits your website to buy a product, sign up for a newsletter, or download a guide, the pixel reports that activity back to your X Ads account. This allows you to measure the real-world impact of your campaigns, not just clicks and impressions.

What This Small Piece of Code Does for You

At its heart, the X Pixel does three vital things for your marketing strategy:

  • Track Conversions: This is the big one. It tells you which of your ads are actually driving sales, sign-ups, or any other goal you define. Without it, you're just spending money and hoping for the best. With it, you can measure your return on ad spend (ROAS) and make data-driven decisions.
  • Optimize Ad Delivery: Once X knows what a "conversion" looks like for your business, its algorithm can get smarter about who to show your ads to. It will prioritize users who are more likely to perform that desired action, stretching your budget further and improving your results over time.
  • Build Retargeting Audiences: Ever visit a website and then see their ads everywhere? That's retargeting, and it's powered by pixels. The X Pixel allows you to create custom audiences of people who have visited specific pages on your site, added items to a cart, or even started but not finished a purchase. You can then run highly targeted campaigns to bring them back and seal the deal.

Simply put, running ads on X without the pixel is like driving with your eyes closed. You might be moving forward, but you have no idea where you're going or if you're hitting your targets.

How to Find Your Twitter (X) Pixel ID: a Step-by-Step Guide

Finding your Pixel ID is a straightforward process once you know where to look. Unlike other platforms where the ID is front and center, on X, it's embedded within the code snippet itself. This guide will walk you through creating a new event source and locating that ID.

Step 1: Navigate to Your X Ads Account

Log in to your X (Twitter) account and head over to the X Ads Manager. You can access it directly by going to ads.twitter.com. If you've never run ads before, you may need to complete your ad account setup, which includes adding a payment method.

From your ads dashboard, look for the main navigation menu. It might be at the top of the page. Click on "Tools."

Step 2: Access the Events Manager

In the dropdown menu under "Tools," select "Events Manager." This is the central hub for all things related to your website tracking.

Note: If you've never created a pixel or event source before, this page might look a little empty. That's perfectly okay! You'll be prompted to create your first one.

Step 3: Create a New Event Source and Find Your Pixel ID

  1. On the Events Manager page, look for a button that says "Add Event Source." Click it.
  2. When prompted to select how you want to collect events, choose the Universal website tag. This is X's primary tracking pixel and covers nearly every use case, from tracking page views to purchases.
  3. An agreement box will appear. Accept the terms and click "Agree & Continue." You will then be prompted to name your event source (e.g., your website's name) and enter the URL. Click "Next."
  4. A final screen will appear confirming the tag has been created. Click the button to "Copy Snippet Code" to copy the full pixel code to your clipboard.

Now that you have the code, you can find your Pixel ID. The ID is not displayed separately, it is embedded directly within the code snippet you just copied. Your unique identifier is the alphanumeric string found inside the twq('config', 'PIXEL_ID'), line.

Let's look at an example code snippet. In the code below, the Pixel ID is o9hsm.


<,!-- Twitter conversion tracking base code -->,
<,script>,
!function(e,t,n,s,u,a){e.twq||(s=e.twq=function(){s.exe?s.exe.apply(s,arguments):s.queue.push(arguments),
},s.version='1.1',s.queue=[],u=t.createElement(n),u.async=!0,u.src='https://static.ads-twitter.com/uwt.js',
a=t.getElementsByTagName(n)[0],a.parentNode.insertBefore(u,a))}(window,document,'script'),
twq('config','o9hsm'),
<,/script>,
<,!-- End Twitter conversion tracking base code -->,

This string of characters is your unique Universal Website Tag ID, which may also be referred to as a "Purchase ID" or "Twitter Tag ID."

The Two Places Your Universal Tag Needs to Go

Once you've got your code snippet, you need to install it correctly for it to start working. You'll typically do this through your website's platform (like Shopify, WordPress, or Squarespace) or via Google Tag Manager.

1. The Base Code

The entire Universal Website Tag snippet you just copied must go on every single page of your site. This is non-negotiable. This base code handles fundamental tracking, like recognizing site visits, and is what allows you to build retargeting audiences. Usually, you place this in the header (inside the `` tag) of your website template so it loads globally.

2. Event-Specific Snippets (Conversion Events)

Next, you'll want to track specific actions, which X calls "conversion events." These are snippets you add in addition to the base code on certain pages. The most common events are:

  • Sign-up: Track registrations for an account, a trial, or a newsletter. This code would go on the "Thank You" page someone sees after they sign up.
  • Purchase: The Holy Grail of tracking for e-commerce sites. This goes on the order confirmation page that a customer sees after a successful payment.
  • Lead: Tracks when someone submits a contact form or requests a demo. Like the sign-up event, this snippet lives on the "success" or "thank you" page post-submission.
  • Add to Cart: Allows you to retarget users who've shown strong interest but haven't yet checked out. This code is triggered whenever someone clicks the "Add to Cart" button.

You can find the specific code snippets for each of these conversion events within the X Ads Manager under your new event source. You will need to add them to the relevant pages manually or through a tag management system.

Troubleshooting Common Pixel Problems

Finding the ID and installing the code is usually smooth, but sometimes things don't work as expected. Here are a few common issues and how to fix them.

"My Pixel has an 'Inactive' or 'Unverified' Status"

This is the most frequent issue people encounter. It means X hasn't detected the pixel firing on your website yet. Here's a checklist to run through:

  1. Give it a few hours: Sometimes there's a slight delay between when you install the code and when X first recognizes it. Let it sit for a few hours before you start debugging.
  2. Verify the base code is on ALL pages: A common mistake is only installing the pixel on your homepage or landing pages. Make sure the 'Universal Website Tag' snippet is in your site-wide header. Visit a few different pages yourself to trigger it.
  3. Double-check for copy-paste errors: Did you accidentally miss a character when copying the code? Or add an extra space? Copy the snippet directly from the Events Manager again and carefully replace the code on your site.
  4. Ad blockers might be the culprit: Many ad-blocking browser extensions will prevent tracking pixels from firing. Temporarily disable your ad blocker and clear your cache, then visit your website. Don’t worry, this won’t affect most of your real visitors, but it helps troubleshooting.

"I've Installed the Events but No Conversions are Showing"

If your base pixel is active but specific conversion events aren't firing, the problem is localized to those event-specific snippets.

Is the Code on the Right Page?

A "Purchase" event code should only go on the final order confirmation page - the URL a customer sees after their credit card is charged. If it's on a product page, it will never fire. Likewise, a "Sign-up" event snippet belongs on the "Welcome!" or "Thank you for signing up!" page that appears after a user submits the form.

Is the Correct Conversion ID Being Used?

When you create different types of conversion events (e.g., Purchase, Lead), each one gets its own unique ID. In the setup process, ensure you are copying the correct event snippet for the right action. The purchase snippet is different from the lead snippet.

Locating and installing your X Pixel ID opens up a whole new level of social media marketing. It's the key to understanding what's working, who your audience really is, and how to turn clicks into genuine customers. Take your time with the setup, verify that it's working, and you'll be on your way to running much smarter ad campaigns.

Final Thoughts

Finding your X Pixel ID isn't meant to be hard, it's just nestled inside the code snippet rather than displayed separately. By following the steps to create an event source, you can easily grab the full Universal Website Tag you need for both base-level tracking and specific conversion events, driving better, measurable results from your campaigns.

As you gather more data from your pixel and see which creatives and audiences are converting, the next step is making that creative workflow as efficient as possible. At Postbase, we built our tool for today's content demands, especially short-form video. Our visual calendar helps you plan what content to boost next, while our straightforward analytics show you which organic posts are already getting traction - so you can turn your best-performing content into ads with confidence, knowing the data already supports your strategy.

Spencer's spent a decade building products at companies like Buffer, UserTesting, and Bump Health. He's spent years in the weeds of social media management—scheduling posts, analyzing performance, coordinating teams. At Postbase, he's building tools to automate the busywork so you can focus on creating great content.

Other posts you might like

How to Add Social Media Icons to an Email Signature

Enhance your email signature by adding social media icons. Discover step-by-step instructions to turn every email into a powerful marketing tool.

Read more

How to Add an Etsy Link to Pinterest

Learn how to add your Etsy link to Pinterest and drive traffic to your shop. Discover strategies to create converting pins and turn browsers into customers.

Read more

How to Grant Access to Facebook Business Manager

Grant access to your Facebook Business Manager securely. Follow our step-by-step guide to add users and assign permissions without sharing your password.

Read more

How to Record Audio for Instagram Reels

Record clear audio for Instagram Reels with this guide. Learn actionable steps to create professional-sounding audio, using just your phone or upgraded gear.

Read more

How to Add Translation in an Instagram Post

Add translations to Instagram posts and connect globally. Learn manual techniques and discover Instagram's automatic translation features in this guide.

Read more

How to Optimize Facebook for Business

Optimize your Facebook Business Page for growth and sales with strategic tweaks. Learn to engage your community, create captivating content, and refine strategies.

Read more

Stop wrestling with outdated social media tools

Wrestling with social media? It doesn’t have to be this hard. Plan your content, schedule posts, respond to comments, and analyze performance — all in one simple, easy-to-use tool.

Schedule your first post
The simplest way to manage your social media
Rating