Setup Twitter Universal Tag & Event-Based Conversion Pixel Tracking Using GTM

Twitter Universal Website Tag is a snippet of code which once put across the website helps you track the conversions and create a remarketing audience to retarget your audience. In simple words, you can also call it as Twitter Ads Tracking Pixel. In a way, Twitter conversion tag features some of the features of Google conversion tracking code, Google remarketing code, and google analytics code. There are a total of five conversion types in the Twitter Ads Dashboard:

  • Site visit: User visits your site
  • Purchase: User completes a purchase of a product or service on your site
  • Download: User downloads a file, such as a white paper or software package, from your site
  • Sign up: User signs up for your service, newsletter, or email communication
  • Custom: This is a catch-all category for a custom action that does not fall into one of the categories above

Let us see how to use the Twitter conversion tag from installing it to creating a remarketing list called Tailored Audience to doing conversion tracking.

Twitter Base Conversion Tag

Base twitter tag is placed across the entire site and it tracks the page views. Apart from tracking the pageview, the base tag does not perform any conversion. We need to create separate conversion tags which are of two types. We will cover creating those conversions in the next section.

  • Log in to your Twitter Ads account.
  • Click conversion tracking under the Tools dropdown from the top
  • Click on Create a new Conversion event. Once you click on that, you will see something like shown below:

Create a new Conversion event in Twitter

  • Select the options as shown in the screenshot above.
  • Once you agree and save the conversion event, you will be presented a code snippet.

Get Twitter Unique Tracking ID

  • Note the Twitter tracking ID from the snippet. Here is an example:

Twitter tracking code snippet

  • In the above case, its o24fa (without inverted coma)

Install the Base Twitter conversion tag using GTM (Google Tag Manager)

  • Login to your GTM (Google Tag Manager) account and create a new tag by selecting tag type as Twitter Universal Website Tag
  • Use the following configuration for your tag
    • Enter the unique tracking ID from the previous step as Twitter Pixel ID
    • Select the Tag event as PageView
    • Select the trigger type as All Pages

Twitter Universal Website Tag Configuration in GTM

  • Once you are done with configuring your GTM tag, you should save and publish this tag.
  • Once you’ve placed the website tag code, return to the Conversions tab in Twitter Ads. You can verify the status of your website tag by finding the tag within the “Conversions” tab.
  • There are three different status types for tags:
    • Tracking: Twitter has gotten pings from the tag within the last 24 hours
    • Unverified: Twitter has not gotten any pings from the tag yet
    • Inactive: Twitter has not gotten any pings from the tag in the last 24 hours
  • You can also use Twitter Pixel Helper to see if the code is firing on a particular page or not.

Once you have the Twitter base pixel, aka Universal Website Tag, installed on your website, you can use that pixel to create other conversion events. Basically, any website will have two types of conversion events:

  • Conversion events based on the page load such as thank you page, cart page, purchase page, etc.
  • Conversion events based on the non-page load such as PDF download, In-page submit, etc.

Page Load Based Twitter Conversion Event

For each conversion which is based on a page load such as purchase page load or thank-you page page-load, you need to create a separate conversion event on the platform. These conversion events will be based on the universal website tag so their Pixel ID will be same. It looks like this.

Page load based conversion event in Twitter

If you notice in the above screenshot, the conversion event is using the universal website tag and conversion is being tracked based on URL. You just need to save this conversion event and you are done. This is same as LinkedIn Pixel Setup. You can notice that base twitter tag and a conversion event based on page load have the same pixel ID as shown below:

Same Tag ID for pageload based conversion

Twitter Event-Based Conversion Tag

You would use event-based Twitter conversion tag in the case when you cannot just track the conversion based on page load. Some of the examples of such event-based conversion will be PDF download, In-Page actions such as clicks, Add to cart or even some page load based conversion events such as the purchase in where you need the purchase amount and quantity value to be passed in the conversion event.

  • Create a separate conversion event for the kind of conversions mentioned above. The steps will be the same except-
  • You need to select “Use a single event website tag”
  • You should also check the option of “create a tailored audience” as shown below

Single event website tag

  • Once you save the conversion code, you will see that your Twitter Pixel ID is different. Note the Twitter ID.

Create Event-Based Twitter Conversion using GTM (Google Tag Manager)

  • Login to your GTM (Google Tag Manager) account and create a new tag by selecting tag type as Twitter Universal Website Tag
  • Use the following configuration for your tag
    • Enter the unique tracking ID from the previous step as Twitter Pixel ID
    • Select the desired Tag event. For example, Purchase or Search, etc.

Twitter Purchase Conversion Tag in GTM

  • Add the necessary parameters for the tag event by selecting the Add Button at the bottom.
  • Assign static values or dynamic values from your data layer for each tag parameter. For example, the “Purchase” tag event will typically include “value” and “currency” parameters.
  • You can pass the dynamic value from the data layer.

Dynamic Event Value

  • Add the necessary triggers to have the tag event load on a specific set of web pages. For example, the “Purchase” event typically fires on order confirmation pages, so our example tag trigger only loads the tag when “purchase” is within the page URL (Your triggers will be specific to your site configuration and URL structure)

Event Exclusion

Do not fire ‘PageView’ tag event when any other specific conversion event is being fired such as add to cart, checkout or purchase tag event. Here is the screenshot of the same:

Event Exclusion

You can see that all the specific triggers such as Cart event or Checkout Event have been combined into one trigger called “Exceptions”. These events have been excluded from the base pixel all pageviews.

Have a Question? Get in Touch!



Leave a Reply

Your email address will not be published. Required fields are marked *