Don't have one? Create one ↗
← All courses

Lesson 4 of 5

X (Twitter) Pixel

① Connect your GTM container

Paste your container ID to load it into this page. It only ever runs here.

Advanced: use a specific environment

X (formerly Twitter) uses the Pixel / Universal Website Tag. Install the base on all pages with your Pixel ID, then fire conversion events on your conversion triggers.

You'll fire a conversion off your purchase event.

Goal

Install the X Pixel and fire a conversion on purchase.

Build it in GTM

  1. Install the X Pixel / Universal Website Tag

    From the Community Template Gallery (or built-in). ID required: Pixel ID.
  2. Install the X Pixel template (or Universal Website Tag), base on All Pages.

  3. Add your Pixel ID.

  4. Fire conversion events on your conversion triggers.

  5. Fire it on a Custom Event trigger for purchase

    Add a Custom Event trigger on purchase and fire the X (Twitter) tag on it, passing value and currency where relevant.
  6. Go deeper

    Browse ready-made, Google-approved options: DumbData: free GTM custom templates (client + server-side).

Debug in Tag Assistant

Copy this lesson's live URL and paste it into GTM Preview, that is the page Tag Assistant connects to. It has the clickable elements, so this page stays clean for reading.

  1. In your GTM, click Preview.
  2. Paste the live URL above and click Connect.
  3. Interact with the live page and watch your tag fire in Tag Assistant.

What you should expect to see

Firing the sample purchase fires the X conversion event in Tag Assistant.

Verify your container

Built it? Export your container, Admin → Export Container, choose your workspace, then drop the JSON here to check it against this lesson.

Drop your container .json here

or browse · checked in your browser, nothing is uploaded