A Developers Guide to Conversion (Link Click) Tracking with Google Tag Manger, Google Adwords, and Facebook

Image for post
Image for post

Say you’re marketing department comes to and they want to run an ad campaign with Google AdWords and they want to be able to track conversions (how many people visited the site, clicked on a button, submitted a form, etc.).

You could just use Google Adwords to do this, but if you ever want to add additional conversion tracking (say they also want to run a Facebook [FB] ad campaign and track conversions for that) you would need to add script tags for FB to each page as well. You would then, also need to add special HTML code to track button clicks if you were just using AdWords and FB.

Instead of adding script tags for multiple tracking services, with Google Tag Manger (GTM) you can consolidate all of your tracking services in one central location and then only add script tags for GTM. GTM also has automatic event tracking (link click detection, form submission, etc.) so you won’t have to add any special HTML code to detect these actions.

Your page will generally have many tags and you will control when these tags fire with triggers. You control when a trigger is fired by using a variable with conditions that evaluate to true or false at runtime. For example, if you have a button and you want to track when someone clicks that button, you would create a trigger that fires x tag (where x=a FB or AdWords conversion) when the link click variable meets the condition ‘the href of the link is https://themostimportantlink.com

How to use GTM to track AdWords and FB click conversions

AdWords Instructions

GTM Instructions

Image for post
Image for post

Congrats! You now have link click tracking conversion set up for AdWords. Now let’s do the same for Facebook.

Facebook Instructions

GTM doesn’t have native support for Facebook but luckily Facebook has a wizard that can automatically add Tags to GTM

Image for post
Image for post
Fig 1.1

Now, whenever someone clicks on a link that has an href of https://themostimportantlink.com our AdWords and Facebook conversions will be triggered.

Wrapping up

When I first started this project, I thought I would need to do a lot more coding, but GTM’s automatic event tracking made adding additional code unnecessary. At first this was confusing, but after I created a few triggers and tags and used the preview mode to confirm everything was working, I began to understand how simple it is to do conversion tracking using a Tag Manager.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store