*This summary was created with AI assistance, using our original content.
It’s not always clear which channel drives results. A Google Ads campaign, a viral blog post, or long-term SEO efforts can all contribute to the same conversions, making attribution difficult without proper tracking. Without accurate data, performance decisions can easily be misleading.
This is where Google Tag Manager comes in. In this post, we’ll cover the basics of Google Tag Manager and how to use it to send website events as page views to Google Analytics.
We’ll also show how Leadfeeder can support similar tracking. If you already understand Google Tag Manager, you can skip the basics and jump straight into the setup.
Note: Want to keep track of your converted leads? Sign up and try Leadfeeder free for 14 days to gain access to relevant data, such as companies visiting your website and viewing your content.
What is Google Tag Manager?
Google Tag Manager is a free tool that lets site owners easily launch and manage code snippets that track actions on a website (and send that data to Google Analytics!) If this isn't part of your website analytics tool belt, you are missing out. Here's why.
Google Tags allow you to track detailed website behavior, such as how many accounts fill out your contact us page, how they get to your website (did that video marketing campaign actually drive leads?), which links they clicked, and even how long they stay on your site.
Note: You can track a lot of this data in Leadfeeder, too!
The main benefit of Google Tag Manager is that it lets non-developers (like your sales or marketing team) manage and track tags without involving your tech or dev teams. More data, better accuracy, and easy enough for a non-dev to set up? Sign me up.
Is Google Tag Manager easy to use? You will need some technical knowledge to make the most of Google Tag Manager. BUT, it is totally doable with a little know-how. (Like this article!)
How to set up Google Tag Manager
Ready to get started? Here's what you need to do.
Sign up for a Google Tag Manager Account. (It's free!)
Add the code to install Google Tag Manager. If you've added Google Analytics tracking or Leadfeeder's tracking code, this step will be easy. If not, follow this guide.
Add tags and start tracking! Here's Google's guide to adding and updating tags. (Don't worry, we'll cover a few ways to use tags below, but that will give you the basics.
If you are already a Leadfeeder user, make sure to integrate Google Analytics and Leadfeeder so you can sort data in our custom feeds.
Now, let's talk about how to track conversions using Google Tag Manager.
What conversions can you track with Google Tag Manager? (and why it matters)
Google Tag Manager lets you track many conversions, including clicks, page views, page URL, and virtual page views. The type of conversion you want to track depends on the action you want your prospects to take.
For us, at Leadfeeder, it’s the sign-up, for example. We want our visitors to sign up for our tool. So, whenever someone visits the last page of our sign-up funnel, we know they’ve converted, that is, signed up.
But we also want to know how they got to that page. Did they start out comparing us to another tool like Albacross, or did they find us by reading our blog about using IP data to improve intent data?
Understanding the path to conversion allows us to create better content and more effective marketing campaigns. Two of the conversions we track the most are conversions by page URL and virtual page views.
Conversion by page URL
If your conversions are based on the page URL, then setting up conversions is simple. All you have to do is go to your Google Analytics settings, create a new Goal, and use Destination in Goal details to set up your URL.
We can track this in Leadfeeder, too, of course. All we have to do is to create a new custom feed based on the Page URL and use this page as the filtering criteria. This Custom feed will then show only those leads that have converted.
Virtual pageviews in Google Tag Manager
One neat trick that Google Tag Manager has is the ability to send virtual pageviews. Virtual pageviews are pageviews that are not actually pageviews. I know, I know. Confusing much? Virtual page views can be triggered by any user action (or other event), and once they are triggered, a page view is sent to Google Analytics.
You can use any triggers you see in Tag Manager. A link click, the new video watched percentage, or a custom JavaScript event, whichever works for you. While you could also use Events to do this, the major benefit of this method is that you can create conversion funnels.
For example, you could create a pageview when a user starts a video, another when they’ve watched 50% of it, and a third when they’ve finished. This gives you a more nuanced view of how users navigate your site and interact with your content.
This pageview will appear as a regular pageview, with the URL and page title (if you want), and all other metrics you are accustomed to seeing with pageviews. Because they are just like regular pageviews, setting up conversions is as simple as in the previous example.
Set up virtual pageviews
Let’s set up a virtual pageview for a button click.
First, we need to identify which button or buttons we want to use for this trigger. We can use the Chrome Inspector to see our identifiers.
In this example, we could probably identify the signup button in the top right corner by using the classes button top-bar__link top-bar__link-button or the link destination https://app.leadfeeder.com/f/sign/up/start?rebranding=true?ref=blog-top-bar or even the text Sign up.
Which identifier(s) you want to use depends on your setup. I would suggest using CSS classes or identifiers, but sometimes link targets or text are better.
To send pageviews from Google Tag Manager, you’ll have to do two things. First, you’ll have to make a trigger - a rule that says when you want to send the pageview. The next step is to create the actual pageview tag, where you can define the pageview details (title, URL, etc.).
Because of how Tag Manager and Analytics work together, you’ll actually need a third thing, too: an Analytics Variable in Tag Manager.
Here's how to do it:
Google Tag Manager sends page views setup
Go to "Tags" and create a new tag. We want to fire an Analytics pageview, so in “Choose tag type” select Universal Analytics. We are creating page views, so in "Track Type" select "Pageview."
After that, create a new Google Analytics variable in Google Analytics settings. Type in your Tracking ID (hint: you should be using a Tag Manager variable for this) and select Fields to set. We want to send the URL and page title, so select the page and title and type in the URL and title, respectively. Save your new Analytics variable.
Now we have the correct Analytics tag that sends a pageview whenever it’s triggered. We haven’t yet set up a trigger, though, so it won’t fire ever. Let’s fix this. In the tag creation screen at the bottom, you'll see a section called Triggering. Click on the section to select triggers. Click on the plus icon on the top right. Now we need the details from the button that we got from Chrome Inspector.
If you can’t see "Click Classes" or "Click URL" in the list, you’ll have to activate them first. They are called Built-in Variables, and you can activate them in the Tag Manager left sidebar “Variables”, clicking "Configure" and selecting the ones you want to activate.
There are some very useful ones, such as Video Title or Video Percentage, that you might want to activate as well. Now you have a new tag that fires on all clicks that match our identifiers. When fired, the tag will send a pageview with a URL and name as you set them up. You can use the Tag Manager preview tool to check that everything works.
Note: Sometimes the virtual pageview is not visible in Google Analytics' real-time tool. If you can’t see visits in Real-Time view, even if everything seems correct in Tag Manager debug, use today’s data in normal reports.
But now you probably want to see which companies are watching your video or downloading your white papers, so you probably have some GTM and Leadfeeder setup to do. See you later!
Note: Want to keep track of your converted leads? Sign up and try Leadfeeder free for 14 days to gain access to relevant data, such as companies visiting your website and viewing your content.