In this post I’ll try to walk through the various ways of effectively implementing Google Ads (formerly Google AdWords) tracking on your site.
The Basics
The basis for running effective advertising campaigns on Google Ads is having the proper pixels in place. Generally speaking you should have two types of tags on your site: A sitewide event (aka Pageview) and a conversion event.
Global Site Tag
Google Ads in its modern form uses the GTAG library which is shared across all of Google’s advertising and analytics products. Similar to any other pixel, this tag is also made of a base tag which loads the JS library and sets the associated tag ID. In GTAG’s case, it will also trigger the basic pageview event too.
<!-- Global site tag (gtag.js) - Google Ads: 1234567980-->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-1234567980"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-1234567980');
</script>
To create a new Global Site Tag, follow the instructions on this post.
In the example above the tag ID that’s loaded is 1234567890. This ID is different from the account ID that’s visible in your Google Ads account.
Once this tag has been placed on all pages (preferably within the HTML’s head section) it tracks all users visiting the site.
This is important for two reasons:
#1 Tracking landing page visits
Not all users that click a certain ad will land on your page. Many times ads are clicked by accident and users click back to the search results page before your site has loaded.
In fact, Google Ads doesn’t send users immediately to your landing page after they click, but rather first sends the click event back to their servers and only then routes the user. This delay varies based on the speed of your internet connection, but leaves enough room for the user to stop the loading.
This is why tracking users that actually have landed on the page is important. This is such a common issue that even Facebook makes the distinction on its ad reporting between Link Clicks and Landing Page Views.
#2 Creating audiences
Once we have the Google Ads tags on all pages we create audiences with custom combination based on the pages visited in multiple custom combinations. This is extremely useful for creating powerful remarketing audiences.
Conversion event
The second, and probably more important part of the tracking is the conversion tracking. This will report back to Google Ads if a certain user has completed a meaningful action on your website – left a lead, completed a purchase or any other meaningful interaction. Based on these conversions, you can decide which ads or keywords perform better, but more importantly, Google’s algorithms will also self optimize towards it.
<!-- Event snippet for Demo Request conversion page -->
<script>
gtag('event', 'conversion', {'send_to': 'AW-1234567980/abcdefghijklmnopqrst'});
</script>
To create a new Conversion Event, follow the instructions on this post.
The event snippet is shorter than the Global Site Tag as it already assumes that it was loaded on that page. This means that the conversion event won’t trigger without Global Site Tag loaded, so be careful to trigger these in the right order.
In the event snippet you can find two IDs. The first is the tag ID which is identical to the one used on the Global Site Tag. The second, referred to as the Conversion Label, is used to identify the specific conversion action. For example, your site might have both a Demo form and a Sign Up form, and you will likely want to measure these separately.
The conversion label is automatically generated when creating the conversion event in Google Ads.
Google Tag Manager Setup
As with most tags, my recommendation is to implement it using GTM.
This leaves little room for error, keeps the scripts used up to date and gives you full flexibility in adding and removing tags.
When setting up the tags via GTM, the order of triggering them doesn’t matter either, so no need to fuss about that too.
To set it up in GTM, first grab the Global Site Tag’s ID (see here where to get it).
In GTM, create a new tag of the type Google Ads Remarketing and paste the ID copied into the Conversion ID field. Set this tag to trigger on all pages.
To set up the conversion event, create a new tag in GTM of the type Google Ads Conversion Tracking. This tag has two slots for the Conversion ID and Conversion Label that you need to paste in accordingly from the Google Ads admin.
Manual setup
If you’re setting up Google Ads manually you probably have also implemented Google Analytics similarly.
With the modern versions of Google Analytics and Google Ads using a joint library, you can combine the various tags to a single snippet.
This effectively reduces the HTTP calls to Google and saves ~20KB.
For example, the snippet below will load both the Global Site Tag for Google Ads (AW-1234567980) and a Pageview event for Google Analytics (UA-98765432-1).
<!-- Global site tag (gtag.js) - Google Ads: 1234567980-->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-1234567980"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-1234567980');
gtag('config', 'UA-98765432-1');
</script>
To properly install the Google Ads Global Tag, add the snippet on all pages of your website, preferably as high up as possible on the <head> tag. Adding the pixel to the <body> tag will also work, but might result in discrepancies in tracking, as some users might leave the page before the pixel snippet has fully loaded.
Once the global tag is loaded on all pages, you can proceed to adding the conversion tracking to specific user actions you want to track.
For example, you might want to trigger a conversion whenever a user submit a lead form.
This will require triggering an event such as this:
<!-- Event snippet for Demo Request conversion page -->
<script>
gtag('event', 'conversion', {'send_to': 'AW-1234567980/abcdefghijklmnopqrst'});
</script>
You can further customize this conversion event by adding the conversion value and custom variables as explained on this post.