Landing Page Tracking with Google Tag Manager

Published September 18, 2015
As a Digital Marketer, you often need to create special-purpose landing pages – most commonly for digital advertising campaigns or email marketing campaigns.
How do you incorporate these landing pages into your analytics and conversion tracking?
It can be tricky because these landing pages may not be part of your main website. They maybe in a subdomain, such as, or even in a completely different domain. So, how to you integrate this tracking with your main website tracking? After all, you need to be able to tie back activity (e.g., sales and conversions) on the main site with lead generation from the landing page.
In addition, you may need multiple types of tracking on the landing pages – Google Analytics, Google AdWords, Bing, etc. You probably don’t want to install and maintain all those trackers.
Sound familiar? If so, this post offers a solution using Google Tag Manager (GTM). GTM gives you tools you can use to integrate Google Analytics tracking on your landing pages with the tracking on your main website. It can also handle deploying multiple trackers (e.g., AdWords, Bing Ads) on your landing pages.
For the purposes of this post, we are going to assume that your landing pages are hosted in WordPress. If that is not the case, most of it will still be relevant to you anyway.


Blog Image Landing Page


Step 1 – Create a Google Tag Manager Container

If you haven’t done so already, create a GTM container. Navigate to the Admin section, and click on the gear symbol next to “Install Google Tag Manager”.


Getting the Google Tag Manager Code Snippet


This will bring up a code snippet that you are going to add to the WordPress site that contains your landing pages.


Google Tag Manager Code Snippet


Step 2 – Install Google Tag Manager on your WordPress Platform

For instructions on installing GTM, see our earlier post: How to Install Google Tag Manager in Wordpress.

Once Google Tag Manager is installed, you can use it to deploy Google Analytics, Google AdWords, Bing Ads, and other types of tracking on your landing pages. The beauty of using Google Tag Manger is that you don’t need modify the code on your WordPress site any further to add these additional trackers. The deployment of additional trackers can be managed from Google Tag Manager simply by creating new Tags.

This magic happens because the GTM tracking code that is already on your site will dynamically load the JavaScript code required to implement any Tags that you create. So, when a user views your landing page, the GTM tracking code automatically loads whatever trackers you have configured (e.g., Google Analytics, Google AdWords) and adds their tracking code to the page. For a more detailed description of how GTM works, see Google Tag Manager: How it works.

Now, lets take a look at how to configure Google Tag Manger to install Google Analytics and Google AdWords.

Step 3 - Installing Google Analytics using Google Tag Manager

The next step is to configure Google Tag Manager to add Google Analytics to your landing pages. To add Google Analytics, you need to know your Tracking ID. To find that, log in to Google Analytics, click on the Admin menu, and then click “Property Settings” under the Google Analytics property that you want to use for tracking your landing pages.


Get the Google Analytics Tracking Id


You then need to copy the Tracking ID you find here in to the GTM Tag that you create for Universal Analytics. To do that, select “Tags” in GTM and click on “New”. Under “Choose Product” select “Google Analytics”. Next, under “Choose a Tag Type” select “Universal Analytics” and click “Continue”. Now, under the “Configure Tag” section, paste the GA Tracking Id into the “Tracking ID” field. Finally, under the “Fire On” heading, select “All Pages” – this will cause a Google Analytics page view to be fired on every page where you have installed GTM.

In our case, this means that every page in the sub-domain will include Google Analytics tracking.


Setting up Google Analytics Tracking in Tag Manager


Managing Google Analytics Across Sub-Domains with Google Tag Manager

We have installed the same Google Tag Manager tracking code on our main website – And, now we are running it on as well. Without some extra configuration, this setup can cause problems. Specifically, whenever a user moves from to (e.g., when they create a Megalytic account), Google Analytics will start a new Session on and list as the referrer. We do not want that, because we want to treat this as one Session and capture the conversion, as well as the Source/Medium, Campaign, etc. that brought the user to the landing page in the first place.

To solve this, we need to configure Google Analytics to treat the hits on and as part of the same Session. If you are not using Google Tag Manger, this configuration involves some confusing custom coding. But, with Google Tag Manager, there is a much simpler approach using Auto Link Domains. Here are the steps that we used.

Going back to the Google Analytics Tag, click on the small pencil icon next to “Configure Tag” to edit the configuration. In order to integrate the landing page domain with the primary domain, set the Field named “allowLinker” to true, and “cookieDomain” to true. And, under “Cross Domain Tracking” enter both domains: and


Google Analytics Link Domains in Tag Manager


NB: Simo Ahava has pointed out to me that, in this specific case, because is a sub-domain of, we do not need to set "allowLinker" to true, nor configure the Auto Link Domains. However, if you are using separate domains, like and, then you would need to configure cross-domain tracking. You can see Simo's comments here.

Next, you need to make some adjustments in your Google Analytics account. Head over to the Admin section of Analytics, and open the Property configuration (center column). Click on Referral Exclusion List to open a table where you can enter domains that are not allowed to be referral sources.


Google Analytics Opening the Referral Exclusion List


You need to add both your landing page domain and your primary domain to the Referral Exclusion List. That way, when a visitor moves from one domain to the other, in either direction, it will not overwrite the Google Analytics Source / Medium.

For example, if a visitor arrived on your landing page from clicking on an AdWords ad, then the Source / Medium for that visit will be “google / cpc”. If you do not have your landing page in the Referral Exclusion List, and the visitor navigates to your main domain, then “ / referral” will overwrite the “google / cpc” data and you will lose track of the fact that this Session can from AdWords.

However, if you add the domains to the Referral Exclusion List as indicated here, then the true source of the visit – “google / cpc” – will be maintained.


Excluding Referrers in Google Analytics


NB: Simo Ahava also pointed that here, because we are working with sub-domains, we only need to include the top-level domain as a referral exclusion. This is because the Referral Exclusion List uses an open-ended match, and will match on Again, however, if you are using separate domains, like and, then you would need to put both of them in the Referral Exclusion List.

Step 4 - Installing Google AdWords Tracking using Google Tag Manager

Once Google Analytics is installed on your landing page, you may want to install additional tracking. For example, if you are driving traffic to your landing page from AdWords, and your landing page includes a form for conversion, you will probably want to track AdWords conversions.

To do that, all you need to do is create an AdWords Conversion Tracking Tag and fire it on the “Thank You” page.

Detailed instructions are provided here: Setting Up Conversion Tracking in AdWords.


Adding tracking to your landing pages is dramatically simplified by using Google Tag Manager. Particularly if your need to install Google Analytics and your landing pages are running on a different domain than your main website. That’s because Google Tag Manager reduces the once complex chore of implementing cross-domain tracking to a simple configuration exercise. In addition, Google Tag Manager makes it easy to add additional tracking code (e.g., AdWords, Bing Ads) to your landing pages without any additional coding.


When the client first came to you, you talked up the value of Google Analytics. You emphasized the importance of seeing where your traffic was coming from. You went on and on about how Google Analytics can show traffic sources to pinpoint whether people came from search, social media or a specific site referral, and how valuable this data was. You sold them on it, so much so that your client looked forward to receiving that first report, the magical day when they would finally understand where visitors were coming from.
But then the report came, and it looked like this:



It showed that 10% of your client’s traffic came from “(direct)/(none)”. What does this label mean? How do you explain Direct traffic to your client? Better yet, how do you explain “none”?
Let’s take a closer look at understanding Direct traffic in Google Analytics and how we can address it with clients.
Digital marketers spend a lot of time focused on PPC and SEO campaigns in order to drive desirable traffic to a website. The phrases we’re ranking for and bidding on get meticulous attention, so much so that we often forget about some of the other ways that visitors find us.

We put a tremendous amount of the effort we put into reviewing organic search data and PPC campaign performance in analytics. But how closely do we monitor referral reports?

If that’s not a channel you review regularly, you may be missing out on seeing traffic that is coming directly from links you’ve obtained around the web, local business listings, news mentions, and more. Many times, links are only considered as a means to an end, a metric that Google uses in determining how to rank sites in the SERPs (search engine results pages). But the fact is, many of a site’s links may be directly contributing to its traffic.

In this article, we’ll review how to look at referral reports in Google Analytics, and some of the many ways to use that data to better inform your web marketing decisions.


Remember how your mom told you not to stand too close to the television because it might hurt your eyes?

The same rules can apply to data. If you’re too close, you may miss the patterns and trends that are crucial to understanding your website’s performance. You can’t judge a site’s performance looking at data in the bubble of a single day, you must consider any day’s traffic compared to the days before and after.

Google Analytics makes it fairly easy to analyze trends over long periods of time. But it also allows you to stand right in front of that TV, to look at more granular levels of time, right down to the hour.
There’s a better way to get that close to the data, without burning your retinas. We’ll cover how to analyze traffic effectively in today’s post.