This project is meant for students that do everything themselves, has no coding background, and/or has limited access to engineers. We'll show you the quick way to set up conversion tracking on simple websites and landing pages. You'll set up GTM yourself from scratch: configure triggers, add tags, and verify everything is working.
Don't worry if you don't get everything right the first time around (that's normal). Phase 5 will show you how to debug and verify the setup.
If you haven’t already, you’ll need to create a GTM account. Head to the GTM website. Create an account and create a container.
There’s a snippet of code you’ll have to put on your site. Add it to the codebase yourself, or ask your engineers to add it.
Once the account is created, you’ll want to configure the variables and triggers you’ll be using to add all the tags to your site.
We’ll do this configuration in a bit of a weird order: built-in variables, triggers, and finally user-defined variables. You’ll need the built-in variables for the other two, and it’s easiest to spec out the user-defined variables after doing defining the triggers.
As a reminder, these are variables that GTM generates automatically, but you still need to tell GTM to create them.
As a reminder, user-defined variables are things like email addresses and first names that change every time someone comes to your site. You want to dynamically pass them from your site to GTM.
As an example of a static variable, we’ll configure your Google Ads Conversion ID to be used for every Google Ads conversion event.
Dynamic variables go beyond the scope of this project and will require an engineer's input. If you'd like to add dynamic variables, see Conversion Tracking > Project: Delegate to Engineers.
Now you’ll want to add GA to every page of your site, and to record every page view.
Some of the channels and third-party tools have useful integrations that make them easier to add to your site. It also means you don’t have to touch any code. We'll first add Google Ads and Hotjar.
Instead of adding code manually, I definitely recommend using the Google Ads integration since it hides away code you’d have to write, and it’ll always be up to date with the latest changes Google makes.
There are three kinds of Google Ads tags you need to add to get it all working:
The Conversion Linker tag is an oddity that you need to add for Google Ads conversion tracking to work properly.
Basically, it helps store data from the visitor’s click from a Google Ads ad, and without it, conversion tracking for Google Ads won’t work.Add the tag and set it to trigger on All Pages.
Create one of these for each conversion event.
You'll need to do:
Adding a remarketing tag allows you to manage remarketing lists in Google Ads. These are lists of people who did something specific on your site, like visiting a page or subscribing to your newsletter.
We’ll be using these later when we set up ads.
You’re going to be using Hotjar for heatmaps and user recording (which we strongly recommend to learn how users are using your site). Add it in using the built-in integration.
LI and Quora have their own native integrations with GTM. You'll just need to supply your Partner ID for LinkedIn, and your Pixel ID for Quora. You can find those on their respective platforms in your account.
Some channels don't have a native GTM integration, so we'll need to install their pixels manually. Open your doc from Conversion Tracking > Project: Conversion Events ****where you had copied over all your ad channels' pixels.The process is the same for all of them: set up a custom tag, and have it fire on every page. Let's do FB as an example.
Copy/paste the pixel code snippet you have for the ad channel. For FB, it would look something like: <!-- Facebook Pixel Code --><script> !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window, document,'script', '<https://connect.facebook.net/en_US/fbevents.js>'); fbq('init', '9999999999999999'); fbq('track', 'PageView');</script><noscript><img height="1" width="1" style="display:none" src="<https://www.facebook.com/tr?id=781779825551730&ev=PageView&noscript=1>"/></noscript><!-- End Facebook Pixel Code -->
We'll now add the triggers to detect when people click a specific button, submits a form, or views a key page. When those triggers fire, we want to report that event to the ad channels and analytics platforms we had set up earlier.
Before you begin, download the Chrome Extensions below. We'll use them in the video to verify if all the pixels and events are firing properly at the end.
Watch the video tutorial in Conversion Tracking - Advanced > Video: GTM Tracking.
Page path
vs Page URL
: Page path returns only the relative path of the page (/about
) whereas Page URL returns the entire address (www.yoursite.com/about
)Congratulations! If you've run through all the verification steps and published everything successfully, then you've completed the Conversion Tracking module. You're good to move on to the next module in the course.