• Courses
    • Courses
    • Course bundles
  • Blog
  • Services
  • Resources
    • Youtube channel
    • E-books and Guides
    • GTM Recipes
    • View All Resources
    • GTM Community
    • GA4 community
  • About
    • About
    • Contact
  • Login
  • Courses
    • Courses
    • Course bundles
  • Blog
  • Services
  • Resources
    • Youtube channel
    • E-books and Guides
    • GTM Recipes
    • View All Resources
    • GTM Community
    • GA4 community
  • About
    • About
    • Contact
  • Login

August 8, 2021

Twitter Conversion Tracking with Google Tag Manager

Updated: August 8th, 2021

If you’re already using Twitter as a marketing tool, you want to measure the results, right? You have multiple options here – remarketing, Twitter conversion tracking, etc. However, everything takes time to implement – you send an email to the developer with requirements of what should be tracked and it takes him weeks to complete the task. But not anymore! With the help of Google Tag Manager, you can speed up the process.

 

Before you continue

This blog post assumes you have a working knowledge of Google Tag Manager tags. If you’re a beginner, I recommend starting here. Want to be up-and-running much faster? Take a look at my GTM masterclass for beginners. The minimum requirements are:

  • You have a Google Tag Manager tracking code installed on your website.
  • You know what tags, triggers, variables, and dataLayer are and how they work in Google Tag Manager.

P.S.  This blog post is a part of a more comprehensive guide – Google Tag Manager + Twitter, so if you’re looking for in-depth information about how to upgrade your Twitter marketing with Google Tag Manager, give it a try.

 

Video tutorial

If you prefer video content, take a look at this tutorial on Twitter Pixel conversion tracking.

 

So What’s the Plan?

If you’re familiar with Google Ads tracking setup process via Google Tag Manager, is particularly the same. All you need to do is to:

  1. Create Twitter Universal Website tag in Twitter Ads account.
  2. Find and copy your pixel id.
  3. Paste it in a particular field of the tag.
  4. Make the tag (or tags) fire after certain interactions you want to track as conversions.

I have described the first 3 steps in this blog post, so before you continue, make sure you have also read Twitter Tracking Pixel + Google Tag Manager.

Twitter conversion tracking is closely related to remarketing. You’ll be using the same Twitter Tag Template in Google Tag Manager, but events will be different. In the blog post about Twitter Pixel, I have created a Twitter Pageview tag, in this blog post we’ll track more precise interactions, like signups or purchases.

Subscribe and Get the Ebook - Real Book Img - GTM for Beginners

 

Different types of events

For every interaction you want to track with Twitter, you’ll need to create a separate GTM Twitter tag. It will use the same Tracking ID pixel from your Universal Website tag but different tag events:

Also, triggers in Google Tag Manager will be different for each event. Want to learn various event tracking techniques? Take a look at my Google Tag Manager courses.

 

Purchase tracking with Twitter Pixel and Google Tag Manager

In this blog post, I will be focusing on purchase tracking (because I believe it is the most important conversion for most businesses). But the same implementation principle applies to other events as well.

The most robust option to track purchases is to ask a developer to push the purchase data to the Data Layer. Once the developer implements this, enable the GTM preview mode and make a test purchase. On the left side of the preview mode, you should see a purchase. Click it and then expand the API call. An example of that data could look something like this:

By the way, if you want to learn more about data layer and purchase tracking, take a look at this course.

Even though there are many data points (related to the purchase) in the data layer, it is completely fine to send at least the revenue and the currency. Since we want to use those two data points and send their values to Twitter Pixel, we have to create two separate Data Layer Variables.

In GTM, go to Variables > New > Data Layer Variable. Create the first variable, which is ecommerce.purchase.currency. Read this to learn more about why I entered the name like this.

Then do the same thing for ecommerce.purchase.value.

Then in GTM, go to Tags > New > Twitter Universal Website Tag and enter the following settings:

I inserted the Twitter Pixel ID constant variable (created in the 1st chapter of this blog post). Also, I have selected the Purchase event. But we are not done yet. We could also send order value and currency together with the Purchase event.

Below the list of possible events, click Add (in the Event Parameters section).

Then you will have to add two parameters (one by one). The order does not matter here so let’s start with the currency. Select it in the first field. In the second field, insert the Data Layer variable (that returns currency) that you have recently created. It will look like this:

Click Add. Then do the same thing for value. Select the value in the first dropdown field and insert the Data Layer variable that returns the order total in the second field. Eventually, the tag configuration will look like this:

twitter pixel purchase tag

In the Twitter Pixel purchase tag, click anywhere on the Triggering section and then click the Plus icon in the top-right corner.

Select the trigger type: Custom Event. If the value of the “event” parameter in the dataLayer.push was “purchase”, enter “purchase” in the trigger’s settings.

Again, I want to emphasize this. I entered “purchase” (all lowercase) because the “event” in the dataLayer.push was “purchase”. Save the trigger and it will be automatically added to the Twitter Pixel tag.

 

Test the setup

Now the time has come to test everything. In the top right corner of the GTM interface, click Preview.

A popup there will ask you to enter the URL which you want to test and debug. It might be the address of a homepage or it might be a specific page’s URL and then press Start.

A new browser tab (or window) should appear where you will see the URL that you entered in the previous popup. At the bottom of that page/tab, you must see the following badge:

And if you go back to the tagassistant.google.com tab, you must see this success message. Click Continue.

If you don’t see the success message or if the preview badge shows that the debugger is not connected, read this.

Make a test purchase on your website. A purchase event should appear on the Preview mode’s left side. Click it and you should see that your Twitter Purchase tag has fired.

Additionally, use the Twitter Pixel Helper Chrome extension. Refresh the page of your website where the preview mode is enabled and Twitter Pixel is activated. Click the Twitter Pixel Helper icon in your Chrome browser. You should see something like this:

Click the “Twitter website tag fired successfully” and then click Advanced Debug Info and you will see more details about the request that was sent to Twitter Pixel.

Great! Now it’s time to publish your changes in GTM. Click SUBMIT in the top right corner, select PUBLISH and CREATE VERSION, and then complete the flow that you will see there.

 

Things To Keep In Mind

  • It may take up to 24 hours for data to appear in the Twitter Ads account (but usually it’s processed much faster).
  • Before you enter tagging “rampage mode”, prepare a measurement plan – a list of what you really need to track. It will bring more transparency, help you plan ahead, and avoid inconsistency problems.
  • Test, test, test before publishing – the devil is in the detail. One tiny mistake can lead to huge problems.

I will not go into details on how to set up the actual ad campaign on Twitter. You can watch this video instead.

 

Where can you find the sales/conversions data in the Twitter Ads interface?

You can find them by going to Campaigns > Ads Manager. Then in the list of all campaigns, switch metrics to Website Conversions. This is the place where you will find purchase data.

If you want to see other conversions, then switch back to Summary.

And click Customize metrics.

Then keep looking for Key Conversions. They are the ones that you select as your main conversions in ad campaigns.

 

Twitter Conversion Tracking: Final Words

Twitter conversion tracking is pretty similar to Google Ads conversion tracking in Google Tag Manager. First, you need to decide which website interactions are important to you. Then set those events within GTM as triggers (e.g. “Visited Thank You Page”) and link them to Twitter Universal Website Tags.

Remember: for every important interaction you need to create a distinct Twitter tag in Google Tag Manager.

Twitter conversion tracking enables you to measure your ad campaigns and see which ones drive more signups or sales.

Also, keep in mind that the data will not appear in real time. Be patient.

 

 

Julius Fedorovicius
In Google Tag Manager Tips
14 COMMENTS
Stephan
  • Oct 9 2017
  • Reply

Thanks for this tutorial! How do you pick up on those events in the Twitter campaign reporting? Will they show up automatically as conversion events?
Thanks!

    Julius Fed
    • Oct 9 2017
    • Reply

    Hey,
    yes, they should appear in your Twitter ads reports (unless Twitter has changed something in the last few months (that's how long I haven't worked with Twitter ads)).

    Cheers

Stephan
  • Oct 9 2017
  • Reply

Hi Julius,
thanks for the quick reply. It's a very detailed question so you probably are not able to answer it ;)
The workflow you suggest is:
1. Create ONE Universal tag in Twitter
2. Create all tags in GTM, say for example PageView and Signup

The question is: Do you need to create a seperate conversion event in Twitter Ads manager for EACH event (PageView and Signup) or is one universal tracking conversion event enough, that captures all different events?

Cheers

    Julius Fed
    • Oct 14 2017
    • Reply

    Hey, for every different event you should create a separate Twitter Universal Tag (just like you do with Universal Analytics tag).

      Rahul Yerande
      • Jan 3 2019
      • Reply

      Twitter Ads manager has conversion event creation , will i need to create separate event for each created Universal GTM Tag.

Barna Szalai
  • Nov 20 2017
  • Reply

Hey Julius,
is it possible to use custom events in Twitter, like in FB as the (pseudo) example shows below:
fbq('trackCustom', 'url-part-to-track', {
conference_id: conf_id,
conference_title: conf_title
});

Or if not, what do you suggest to send custom data for conversion tracking?
I use GTM btw.

Thanks

    Barna Szalai
    • Nov 20 2017
    • Reply

    More info: in the conversion tracking help, I read the following:
    Conversion types explained:
    ...
    "Custom: This is a catch-all category for a custom action that does not fall into one of the categories above"

    But didn't find any examples searching on google, only for the standard methods like PageView, AddToCart etc..

      Julius Fed
      • Nov 22 2017
      • Reply

      Hey,

      Honestly, I haven't tried tracking custom events with Twitter so I'm not sure whether it works at all.

      I guess I'll need to do some tests in the future and maybe it will become another blog post :) In the meantime, I have no other suggestions how to track custom event with Twitter Pixel.

      Cheers

Panneer selvam
  • Jan 30 2019
  • Reply

I have Implemented MACT through API in both IOS and Android. I have Implemented API's like App Install, checkout and purchase.I'm getting alert in Twitter (Conversion tracking isn't set up for this app. Without it you won't be able to see ROI metrics or track custom events. Set up conversion tracking) conversion not yet Implemented. Is it possible to do Twitter Analytics using Api without using third party tools.

    Julius Fedorovicius
    • Feb 1 2019
    • Reply

    I don't know as this is not related to Google Tag Manager.

Kavita
  • Aug 2 2019
  • Reply

Does OG tags can be integrated in GTM?

Sumit Kumar
  • Sep 12 2021
  • Reply

Very Interesting And Informative Article.
I have bookmarked your blog.
Thanks for share such type of precious information.

Gianna
  • Jun 14 2022
  • Reply

Hey Julius, my question is probably more specifically related to the Twitter side of things so I understand if you're not sure.

I've followed this guide and everything seems to be tracking well, the purchase event is being triggered and appears in Twitter's Event Manager. However, when I'm looking at my Ads Manager it says there's been 0 purchases against my campaign. Do you know why this may be?

    Julius Fedorovicius
    • Jun 16 2022
    • Reply

    Maybe Twitter needs more time to process the data. Or maybe something is configured incorrectly.

Leave a comment Cancel reply

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

 

Hi, I'm Julius Fedorovicius and I'm here to help you learn Google Tag Manager and Google Analytics. Join thousands of other digital marketers and digital analysts in this exciting journey. Read more
Analytics Mania
  • Google Tag Manager Courses
  • Google Tag Manager Recipes
  • Google Tag Manager Resources
  • Google Tag Manager Community
  • Login to courses
Follow Analytics Mania
  • Subscribe to newsletter
Recent Posts
  • Introduction to Google Tag Manager Server-side Tagging
  • 3 Ways to Pull Data from Data Layer with Google Tag Manager
  • Cannot See the Google Tag Manager Option in Google Ads Conversion?
Analytics Mania - Google Tag Manager and Google Analytics Blog | Privacy Policy
Manage Cookie Settings