SaTracking
PlatformsUPDATEDIntermediate

Install X Pixel and configure a website event

Add the current X Pixel base code, use the generated event ID, and check it with Pixel Helper.

Download for AI (.txt)

Measurement topic illustration · SaTracking

Before you start

Load the current X Pixel base, fire one generated event ID after success, and validate the tag and parameters in Pixel Helper and Events Manager.

1. Install the X Pixel base

X creates an account-specific tag in Events Manager. This is the current base pattern: it loads uwt.js and configures an advertiser ID. Replace the placeholder with your own ID; do not publish this example unchanged.

html
<!-- X Pixel base example; use the advertiser ID in your account -->
<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_ADVERTISER_ID');
</script>

Place the base on eligible pages, then create the event in Events Manager. X supports Google Tag Manager and its current templates. Follow the website conversion instructions, not an old Universal Website Tag guide.

2. Fire the event after success

Copy the generated event ID and call it after the conversion succeeds:

js
twq('event', 'tw-YOUR_ADVERTISER_ID-YOUR_EVENT_ID', {
  value: '79.99',
  currency: 'USD',
  num_items: '1'
});

The identifier and values are placeholders. Map the transaction values from your application and use the exact event ID from X. If you use X's GTM partner flow, enable its data-layer standard-event mapping when applicable and verify it. A data-layer message with no configured X tag sends nothing to X.

3. Validate the event

Use X Pixel Helper and the Recent Activity Log in Events Manager to check the tag, event, parameters, and sending domain. Check GTM Preview and browser Network when you use a manager. The Pixel Helper help page covers browser validation.

Honor consent before loading the base or firing an event. Wrong or legacy IDs, duplicate tags, a premature event, or CSP restrictions can block or distort the test. Use the dashboard to check what the browser exposes, then verify the conversion in X Ads and Pixel Helper.

Official references

EDITORIAL HISTORY

What changed

  1. v1.0
    Initial bilingual guide; provider setup and validation steps checked against official documentation.
  2. v1.1
    Revised both language versions with verified provider code and clearer data-layer-to-tag mapping; checked official setup and validation references.
MEASUREMENT SUPPORT

Need a hand with your tracking?

Nicolas Salazar works with teams on analytics, tracking plans, data quality, consent, and implementation.