Saturday, July 27

Google Tag Manager

How to do Path Analysis in Google Analytics 4
Google Tag Manager

How to do Path Analysis in Google Analytics 4

Analysis Hub in Google Analytics 4 is a suite of features that allow you to dive deeper into your data. In the past, I have explained how to work with Exploration reports and Funnel Analysis. This time, let’s take a look at another type of report, Path Analysis. In Universal Analytics (GA3) flow reports were quite limited (that’s why I rarely used them). But with GA4, the improvement is obvious. Even though Path Analysis is not perfect and there is more room for enhancements, you can already achieve more with it than with flow reports in GA3. In this blog post, I will show you how to use them and will share several ideas of what can you analyze next. Table of Contents + Show table of contents + What is Path Analysis? #1. Overview of the interface #1.1. Variables #1.1.1. Segme...
Page Path vs Page URL in Google Tag Manager
Google Tag Manager

Page Path vs Page URL in Google Tag Manager

Updated: May 7th, 2021 If you’re just starting with web tracking and have absolutely no prior technical knowledge of the web, you might be confused about which Page variables (in Google Tag Manager) to use when. Questions like “what is the difference between Page Path and Page URL?” might be quite common. That’s why I’ve decided to publish a quick guide comparing Page Path vs Page URL so that you would have a better understanding of it. Page Path vs Page URL in GTM Page Path returns way less info compared to the Page URL. Page Path returns only what comes after the hostname (domain) but before: the question mark “?” (a.k.a. query parameters) hashmark “#” (a.k.a. URL fragment) colon “:” (a.k.a. port). It just returns the subdirectory (page) on which you currently are. If you wa...
JavaScript Variable in Google Tag Manager: Quick Guide
Google Tag Manager

JavaScript Variable in Google Tag Manager: Quick Guide

Updated: May 7th, 2021 If you have ever tried to find more information about the JavaScript variable in Google Tag Manager, here’s what you’ve probably seen: 1 paragraph in Google’s official documentation, a bit more in Simo Ahava’s guide. But in general, not much. So I decided to dig deeper and give you a bit broader picture of what’s behind that mystical name, JavaScript Variable. This is not a Custom Javascript Variable I noticed that some people confuse JavaScript Variable with Custom JavaScript Variable in Google Tag Manager. Those are two totally different concepts. JavaScript Variable retrieves a value of a global variable, e.g. Page Title, Page URL, etc., while Custom JavaScript is a function that might be much more complex, e.g. return a clicked text but in lower case, or get a ...
How to Exclude Internal Traffic in Google Analytics 4
Google Tag Manager

How to Exclude Internal Traffic in Google Analytics 4

When you implement Google Analytics 4, you are tracking your own interactions/events as well. That’s the default. That becomes even a larger problem when you’re working with a larger business (having more employees). Every visit/event made by an employee skews your data. Luckily, this can be fixed because you can exclude internal traffic in Google Analytics 4. But there are several catches here. If you exclude yourself, you won’t be able to see your events in the DebugView (while testing with GTM). At least that’s what I noticed while debugging. This is inconvenient. And if you have to exclude multiple people, relying on the IP address might not be the best option. In this blog post, I wanted to show you how to exclude internal traffic in Google Analytics 4 and also tackle the aforementi...
Cross-domain tracking in Google Analytics 4
Google Tag Manager

Cross-domain tracking in Google Analytics 4

Note: If you are looking for a Cross-domain tracking guide for Universal Analytics, read this guide instead. If you are familiar with cross-domain tracking in UA, you probably know that most of the configuration is done either on the code level (e.g. in gtag.js) or in GTM (GA tags). Because of that, many marketers and web analysts were confused about what to do where. Luckily, in Google Analytics 4, things have been greatly simplified. In this guide, I will show how to configure cross-domain tracking in Google Analytics 4. First, we’ll start with the problem that cross-domain tracking solves and then we will go to the actual configuration. Table of contents The problem of multiple domains What is cross-domain tracking in Google Analytics 4? How does cross-domain tracking work in G...
Custom metrics in Google Analytics 4
Google Tag Manager

Custom metrics in Google Analytics 4

If you have tried to configure Google Analytics 4, you should already be familiar with custom dimensions. Basically, any custom text parameter that you send to GA4 (and that you want to use in the reports), should be registered as a custom dimension. But you can also customize your setup by sending custom metrics. What are they and how can you configure them? In this blog post, I’ll share the steps on how to configure custom metrics in Google Analytics 4. First, let’s start with some theory, and then we’ll dive into the practical stuff. Table of contents What are dimensions in Google Analytics? What are metrics in Google Analytics? A number can also be a dimension Examples of Custom Metrics How to configure custom metrics in GA4? #1. Update the GA4 event tag #2. Test the...
Scroll tracking with Google Analytics 4 and Google Tag Manager
Google Tag Manager

Scroll tracking with Google Analytics 4 and Google Tag Manager

Compared to Universal Analytics, Google Analytics 4 offers more built-in tracking capabilities. This includes file downloads, outbound clicks, scroll tracking, and more. But did you know that the built-in scroll tracking in Google Analytics 4 tracks only when someone scrolls below the 90% percent mark of the page height? What if you want to track other thresholds as well (e.g. 25%, 50%, 75%)? Maybe in the future, that will also become built-in, but as of the moment of writing this blog post, it’s either 90% or nothing. In this blog post, I wanted to show you how to implement scroll tracking with Google Analytics 4 and Google Tag Manager. There are two possible approaches here and I’ll explain them both. Also, I’ll show several examples of the Analysis Hub report where you can see your scro...
Google Tag Manager

“Pages per Session” Conversion in Google Analytics 4

In Universal Analytics, conversions were called “goals” and there were several types of them that you could create: destination-based goal, event-based goal, session-duration-based, and a goal that counted based on the number of pages per session. When Google Analytics 4 was introduced, it was still pretty simple to recreate destination-based and event-based goals/conversions. But about the other two types? Currently, conversions based on session duration (e.g. if a session is longer than 5 minutes, that’s a conversion) would still require some additional code (or input from developers), thus it’s quite challenging (I’ve added this idea to my backlog of ideas for blog posts). But if you want to track conversion if a visitor views 3 or more pages per session, that is completely possible ...
How to Use Exploration Reports in Google Analytics 4
Google Tag Manager

How to Use Exploration Reports in Google Analytics 4

Compared to Universal Analytics, Google Analytics is missing a lot of predefined reports that we are familiar with (e.g. landing page, site search, etc.). I don’t know if this will change in the future, but I hope so! In the meantime, we got a pretty powerful suite of reporting capabilities called Analysis Hub. It’s the place where you can do ad-hoc analysis and dig deeper into your data. In today’s blog post, I wanted to focus on one particular part of it, Exploration Reports in Google Analytics 4. Table of contents Main components Variables Segments Dimensions and metrics Tab settings Segment comparisons Rows Columns Values Filters The Output (report) Examples of Exploration reports Landing pages report Order coupon code report Additional things ...
Google Tag Manager

Enhanced Measurement in Google Analytics 4: The Guide

When installed on a website (without any additional configurations), Universal Analytics (a.k.a. GA3) was tracking just page views. If you want to see any other interactions in your reports, you’d have to implement additional event tracking. To improve that, Google Analytics 4 offers more out-of-the-box interactions that are tracked without the need to change the website’s code or configure a GTM container. That suite of auto-tracking features is called Enhanced Measurement. Of course, you will still need to implement a bunch of recommended or custom events to get the most out of GA, but the enhanced measurement is a welcome addition for those who are just looking for very basics. However, there are some nuances as well (that I’ll also talk about).   Table of Contents + Hide table of co...
Google Tag Manager

Track Clicks with Google Analytics 4 and GTM

If you are just starting to get a grip on Google Tag Manager, click tracking is probably one of the most demanded things you want to implement. There are many clickable elements on your website and you want to understand how website visitors are interacting with them. In this blog post, we will take a look at how to track clicks with Google Analytics 4 and Google Tag Manager. First, we will look at some automatic click-tracking capabilities in GA4, and then we will extend the list of tracked events with help of GTM. By the way, if you are completely new (or just starting) with Google Analytics 4, download my free e-book below. Ready? Let’s get started. Table of contents + Hide table of contents + Why track clicks? Automatic click tracking in GA4 (Enhanced Measurement) Track...
A Guide to DebugView in Google Analytics 4
Google Tag Manager

A Guide to DebugView in Google Analytics 4

When you implement something in Google Analytics (or any other platform), never trust your gut. Always verify that the data was actually received by the platform and is displayed in reports the way you expect it. In Universal Analytics, this was done by checking real-time reports (to verify events, conversions, page views). But if you wanted to debug things like Enhanced Ecommerce, you had to wait until the data lands in the standard reports. This means hours of delay between the configuration and the actual debugging. Luckily, that has changed in GA4 with a new feature called DebugView (I mean, it’s new if we compare to Universal Analytics). DebugView in Google Analytics 4 allows checking the incoming data at a more granular level (without the need to wait for hours). Table of Conte...
Recommended Events in Google Analytics 4
Google Tag Manager

Recommended Events in Google Analytics 4

There’s a lot to cover when it comes to event tracking in GA4. But since the platform is now event-based, it’s natural that I have a bunch of guides related just to events. In this quick guide, we’ll take a closer look at one group of events, recommended events. The list of recommended events (in alphabetical order) I presume that some of the visitors of this blog post are just looking for the full list of all recommended events in Google Analytics 4. If you’re one of them, then here it is. I have combined all lists from Google’s documentation into a single list. But if you want to learn the full picture of the recommended events, then jump to the next chapter and read/watch with great attention. add_payment_info (when a user submits their payment information). Parameters: coupon, curre...
A Guide to Custom Dimensions in Google Analytics 4
Google Tag Manager

A Guide to Custom Dimensions in Google Analytics 4

The thing with Google Analytics (or any other similar tool) is that it won’t help you much if you use it just “out of the box”. I’m talking about the classic “just add one line of JavaScript to your site and start tracking”. If you want to benefit from a platform, you have to customize your data collection. Every business is unique and you might want to track different things in order to understand how different parts are performing. And one of the ways how you can customize it is custom dimensions. Instead of just having some generic data, you can go really deep with your setup. Even though Google Analytics 4 offers better automatic tracking capabilities (compared to Universal Analytics), that’s not enough. In this blog post, I’ll show you how to configure Custom Dimensions in Google A...
Google Tag Manager

The Magic of Google Tag Manager and Cookies

Cookies are a super important part of the web. Imagine the world without them: you wouldn’t be able to use your Facebook or Twitter. They help retain data throughout a user’s visit on a webpage, so naturally, they’re an important component of web analytics, as well. By default, Google Analytics and other analytics tools use cookies in order to track users’ behavior on your website. Unfortunately, I still see many marketers (working with GTM) suffering over not being able to fire Tags for returning visitors, or after 4 page views, etc. But this shouldn’t be a problem since you can use Google Tag Manager to set and retrieve data from cookies in a fairly easy way. In this blog post, I’ll show you how to easily utilize cookies with Google Tag Manager and take your web tracking to the next le...