leadstoolpack

Home › How-tos › The Secret Setups › X (Twitter)

The Secret Setups · 16 of 20

How to track X (Twitter) Pixel conversion events in Tag Manager

Live guide · Checked 28 October 2026 · Updated 28 October 2026 · Checked every week against X (Twitter)'s own help pages

Install the X Pixel through Tag Manager and fire an X conversion event when a lead arrives, so X Ads counts and optimises for leads.

Time
15 minutes
You will need
  • An X Ads account
  • Google Tag Manager with the generate_lead trigger
  • Consent Mode set up
Stuck?
Troubleshooting or ask us a question

Step by step

  1. Make the pixel and event

    In X Ads Manager go to Tools > Events Manager. Add your pixel if you don't have one (Add event source > Install with pixel code), then Add events: name it Lead, type Lead, method Define event with code. Copy the Pixel ID and the Event ID (it starts tw-).

  2. Add the base pixel

    Tags > New > Custom HTML on All Pages, ad_storage required:

    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>
  3. Fire the event on a lead

    A Custom HTML tag on CE - generate_lead, base pixel sequenced first:

    HTML
    <script>
      twq('event', 'tw-YOUR_PIXEL_ID-YOUR_EVENT_ID', {
        value: {{DLV - value}},
        currency: '{{DLV - currency}}',
        conversion_id: '{{DLV - lead_id}}'
      });
    </script>

    Copy the full event ID exactly as Events Manager shows it.

  4. Test with Pixel Helper

    Install the X Pixel Helper extension, send a test lead and check the event fires. In Events Manager the event shows Active once received.

  5. Publish

    Publish, then choose the event in your campaign's conversion settings.

Tips from people who set these up every week

  • conversion_id stops a lead being counted twice, and matches the X Conversions API if you add it later.

Troubleshooting: questions and answers

The event never turns Active.

Check the event ID has both parts (pixel and event) and the base pixel fired first.

Official help pages

Let Claude fix the rest of your funnel

Lead Focus is 12 Claude Skills that find the stage of your funnel that's costing you leads, then fix it: ads, landing pages, follow-ups and tracking. One payment, 12 months of updates, and a 14-day refund.

Get Lead Focus · $29.99

Still stuck, or have a question?

Tell us where you got to and what you see. We read every message and reply by email, usually the same working day.