Skip to content
FunnelGuard

Fix guide by FunnelsGuard

X (Twitter) pixel missing or wrong ID: how to find and fix it

TRK-226Medium impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

The X pixel is a small script from X (formerly Twitter) that you place on your website. It reports page views and actions, such as a form submit or a purchase, back to your X Ads account. The script is set up with a pixel ID, a short code that tells X which account the data belongs to.

This issue has two forms. Missing: the base code is not on some or all pages, or a tag manager rule stops it loading. Wrong ID: the code loads, but the ID is a typo, a leftover from an old account, a test ID or a client's ID copied from another site. In both cases X does not get the data you expect.

Why it costs you leads or sales

Your visitors still see the site and still convert. What you lose is the signal X needs. Without it, conversions in X Ads Manager show zero or too low, you cannot build audiences from site visitors, and X's delivery cannot learn which people convert. You may cut a campaign that was working, or keep paying for one that looks fine but is not measured.

Where the signal is lost
  1. Ad clickVisitor arrives from an X ad
  2. Landing pagePage loads normally
  3. X pixelMissing, or loads with the wrong ID
  4. Conversion eventNot recorded in your X account
  5. Optimisation and audiencesNo data to learn from

The visitor journey works, but the data never reaches the right X account.

Conversions you see vs conversions that happenExample numbers
Conversions you see vs conversions that happen (example)Real leads: 40 conversions; Reported in X (correct ID): 38 conversions; Reported in X (wrong ID): 0 conversions0153140380Real leadsReported in X (correc…Reported in X (wrong …conversions

Example: 40 real leads from X traffic in a month, but X Ads Manager only shows the ones from a page that still has the right pixel.

How to check if your site has it

Check the X pixel in about five minutes
  1. Find your real pixel ID

    In X Ads Manager open Tools, then Events manager. Your pixel ID is shown on the Event source (website tag) details. Note it down.

  2. Open your site in a private window

    Visit a landing page, the thank-you page and a key product or form page. Accept cookies if a banner appears, since many sites load the pixel only after consent.

  3. Look at the network requests

    Open browser developer tools, go to the Network tab and filter for 'ads-twitter' or 't.co/i/adsct'. You should see the library (uwt.js) load and a request to t.co or analytics.twitter.com. The pixel ID appears in the request parameters (tw_id or the config ID).

  4. Compare the ID

    Check that the ID in the request matches the one in Events manager. A different ID, or no request at all, confirms the issue.

  5. Search the page source

    View source and search for 'twq('. Look for exactly one base code block and an ID in the config line. Two different IDs means two installs fighting each other.

  6. Check conversion pages too

    The base code must be on the page where the conversion happens, and any event code must use your event ID from Events manager.

How to fix it

The fix is the same everywhere: one base code, on every page, with the correct pixel ID, loaded once. Where you edit it depends on how the pixel was installed. First, remove any old or duplicate installs so only one remains.

X base code (replace YOUR_PIXEL_ID)html
<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','YOUR_PIXEL_ID');
</script>
Fix it on your platform
  1. Open the X tag

    Find the tag that loads the X pixel. If you use a Custom HTML tag, check the twq('config', ...) line. If your container has an X template tag, check its pixel ID field.

  2. Correct the ID

    Paste the ID from Events manager. Do not hard-code different IDs across several tags.

  3. Set the trigger

    Fire the base tag on All Pages, or on All Pages after consent if you use a consent banner. Make sure no exception blocks key pages.

  4. Preview and publish

    Use Preview mode, confirm the tag fires on the landing and thank-you pages, then publish a new container version.

Then fix the conversion events
  1. Create the event in Events manager

    Add a conversion event for the action you care about, such as a lead or purchase, and copy its event ID.

  2. Fire it on the right action

    Trigger the event code on the thank-you page or the form success action, after the base code has loaded.

  3. Avoid double installs

    If both GTM and hard-coded code fire the base tag, remove one.

How to confirm it's fixed

Confirmation checklist
  • The uwt.js library loads on landing, form and thank-you pages
  • The request to X carries the ID shown in Events manager
  • Only one base code block and one ID appear in the page source
  • The conversion event fires once on the success page
  • The Events manager event source shows recent activity (it can take a while to update)
  • Tested again after consent is accepted and after a cache purge

How to prevent it happening again

Pixels break quietly after theme changes, tag manager edits, new landing pages and migrations. Keep the pixel ID in one documented place. Make one person responsible for tracking changes. After every site or tag release, run the network check above on your top landing page and thank-you page. For agencies, keep a list of each client's pixel ID so IDs never cross over.

How FunnelGuard handles this

FunnelGuard detects this issue today. A robot visitor runs your real customer journeys on a schedule, from the EU or the US, and checks the tracking hits sent to ad platforms, X included. If the X pixel is missing or the hit does not arrive as expected, the check fails. A failure is re-checked from a second region before one alert goes out, by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. Test traffic is marked (utm_source=funnelguard, fg_test=1), never clicks real ads and never enters real card details. The Free plan covers 1 site and 2 journeys with daily checks and no card, and a free read-only website audit is available.

Questions people ask

Why is my X (Twitter) pixel not firing?

Common causes are the base code missing from some pages, a tag manager trigger that does not match, a consent banner blocking it until accepted, or a cache serving old code. Open the Network tab and look for the uwt.js request and a call to t.co or analytics.twitter.com to see which case you have.

How do I find my X pixel ID?

In X Ads Manager, open Tools and then Events manager. Your website event source shows the pixel ID and the base code. Copy it from there rather than from old emails or another site.

How do I know if my X pixel has the wrong ID?

Compare the ID in the pixel request, or in the twq('config', ...) line in your page source, with the ID in Events manager. If they differ, the data goes to another account or nowhere.

Can I have two X pixels on one page?

You can, but only if you deliberately track two accounts. A duplicate install of the same pixel, such as GTM plus hard-coded code, can double count events, so keep one base code per ID.

Why does X Ads Manager show no conversions when my site gets leads?

The pixel may be missing on the thank-you page, the conversion event may not be set up or fired, or the ID may be wrong. Check the base code and event code on the page where the conversion happens.

Does the X pixel work without cookie consent?

That depends on how you set it up. Many sites load marketing tags only after consent, so a visitor who declines is not tracked. Make sure the pixel does load after a visitor accepts.

How can I monitor my X pixel automatically?

FunnelGuard runs your journeys on a schedule with a robot visitor and checks that the X hit is sent. It re-checks failures from a second region and sends one alert with a screenshot and a likely cause.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.