top of page

How to Install the X Ads Pixel (Twitter Pixel) with Google Tag Manager

  • Writer: Sotirios Seridis
    Sotirios Seridis
  • Jun 13
  • 3 min read

Updated: Aug 25

Want to track conversions, optimize ad delivery, and run remarketing campaigns on X (formerly Twitter)? You need the Twitter Pixel, now called the X Ads Pixel. By installing it through Google Tag Manager (GTM), you can easily deploy and manage your pixel events without touching your website’s code. In this quick guide, you'll learn how to set it up properly, fire key events, and start measuring real performance.






Install the X Ads Pixel (Twitter Pixel) with Google Tag Manager:


  1. Login to X Ads (Twitter Ads)

  2. Navigate to Tools (top menu)

  3. Select Events manager

  4. Select "Add event source"



    from here you have two options:


    Option 1: Custom HTML


    1) Copy the Pixel code in X Ads

    2) Login to your Google Tag Manager

    3) Create a New Tag

    4) Under Tag Configuration select Custom HTML

    5) Paste the Pixel code

    6) Click on Triggering and select All Pages

    7) Save, Submit and Publish your Google Tag Manager Container


    ---


    Option 2: Use Twitter Base Pixel Template


    1) Copy the Pixel ID in X Ads

    2) Login to your Google Tag Manager

    3) Create a New Tag

    4) Under Tag Configuration click on Community Template Gallery

    5) Select the Twitter Base Pixel

    6) Paste the Pixel ID

    7) Click on Triggering and select All Pages

    8) Save, Submit and Publish your Google Tag Manager Container




Frequently Asked Questions on How to Install the X Ads Pixel (Twitter Pixel) with Google Tag Manager



1. What is the X Ads Pixel (Twitter Pixel)?


The X Ads Pixel is a small piece of JavaScript code that lets you track user actions on your website, measure conversions, build custom audiences, and optimize performance for your X (formerly Twitter) ad campaigns.



2. Do I need coding skills to install the X Pixel with GTM?


Nope! With Google Tag Manager, you can install the pixel without editing your site’s code. GTM makes it easy to deploy the pixel and manage events using its visual interface.




3. Where can I find my X Ads Pixel ID?


Log in to ads.twitter.com, then go to:Tools > Events Manager > Twitter Pixel.Copy the Pixel ID – you’ll need it when setting up the tag in GTM.




4. What tag type should I choose in Google Tag Manager?


Select “Custom HTML Tag” and paste the full pixel base code (provided by X Ads) into the HTML field. This will load the pixel on your chosen pages.




5. When should I fire the pixel tag?


You typically fire the base pixel on all pages using the “All Pages” trigger. For conversion events (like sign-ups or purchases), use additional event tags triggered on specific URLs or interactions.




6. Can I track specific actions like purchases or form submissions?


Yes! Use event snippets provided by X Ads to track standard events like "Purchase", "SignUp", or "AddToCart". You can create separate GTM tags for each event.




7. How do I test if the X Ads Pixel is working?


Use the Twitter Pixel Helper Chrome Extension or check the Events Manager in X Ads to see if data is being received.




8. Can I install multiple X Pixels with GTM?


Yes, but each pixel should be in a separate Custom HTML Tag with distinct triggers. Avoid duplicating pixels on the same page to prevent data issues.




9. Will installing the pixel slow down my website?


The pixel is lightweight and loads asynchronously, so it has minimal impact on page speed when implemented correctly via GTM.




10. Is the X Ads Pixel GDPR-compliant?


Yes, but you should trigger the pixel only after user consent, especially in regions where GDPR applies. Use consent mode or a cookie banner that integrates with GTM.



 
 

Recent Posts

See All
Youtube Updated.png
WhatsApp Logo.png
bottom of page