RSSAmplifier

Blog

Google Tag Manager and Google Analytics on Simo Ahava's blog

Recent content in Google Tag Manager and Google Analytics on Simo Ahava's blog

simoahava.comRSS feed ↗451 posts

Latest posts

#GTMTips: Split GA Events Between Client-Side And Server-Side Dispatch

Thanks to Giovani Ortolani Barbosa for reminding me about this possibility within Google Tag Manager and thus inspiring this blog post. If you’re running server-side Google Tag Manager (SGTM), you’re probably sending your Google Analytics events directly to SGTM, where they are then forwarded to Google, Meta, LinkedIn, and any number of other vendor endpoints. While doing so, you might…

Google Tag Manager UI Updates

In preparation for the upcoming major integration between Google Tag and Google Tag Manager , Google has rolled out some user interface changes to your GTM containers. The changes simplify the UI quite a bit, with the biggest changes landing on the Overview dashboard and the navigation. In this article, I’ll take a look at the changes and I’ll also show what the new event editor /…

Add IPv6 Support To Your Server-side GTM Load Balancer

UPDATED 20 March 2026 : Shortly after publishing this article, Google Cloud changed how Load Balancer frontend certificate management works. Instead of directly mapping a frontend to a certificate, GCP now wants you to use a certificate map . Luckily, creating one is (fairly) simple, and I’ve updated the guide below to instruct how to do this. If you’re running server-side Google Tag…

Run Server-side Google Tag Manager On Localhost

Server-side Google Tag Manager is essentially a server application (running on Node.js ), which Google has helpfully composed into a Docker image . Docker , on the other hand, is an environment for creating, sharing, and running applications, right from the Docker platform itself. In short, it’s a way to package an entire application and its execution environment, so that anyone (or any…

#GTMTips: How To Load Google Scripts From A Server Container

On June 30, 2025 , Google announced that they are consolidating how Google’s script libraries for the web (e.g. gtm.js and gtag.js ) are loaded when using a server-side Google Tag Manager container. Before, you had the Web Container Client for loading the gtm.js file, and you had the Google Analytics 4 Client for loading the gtag.js file. Now, you only use the former. There is also the…

Common Mistakes When Working With Click Identifiers

This is a guest post by Jude Nwachukwu Onyejekwe . He is a prolific content creator, and he curates the DumbData portal, which is full of great, free resources for measurement enthusiasts. In this article, he shares some useful learnings for working with click identifiers . Click IDs are URL parameters used by ad platforms. They are attached to outgoing links (ad clicks), so that when the user…

Basic Consent Mode: The Guide

Google’s Consent Mode is a way to control how tags react to the user’s consent for different tracking purposes. It is specifically designed to work with Google’s tags , but especially through Google Tag Manager, you can use Consent Mode’s features and APIs to control other tags, too. Consent Mode comes in two “flavors”: Advanced Consent Mode is specifically…

Clarification On GTM Auto-Loading Google Tag For Ads And Floodlight Events

Google Tag Manager users received an email on March 11th, where Google announced a very cryptic update to Google Tag Manager: As is typical with Google’s email communications, the email raised more questions than it answered. Even though I tackled the email in a LinkedIn thread , there’s still a lot of misunderstanding (and misinformation) going about. In this short article, I’ll…

#GTMTips: SGTM Fetches GA4 Configurations Automatically

One of the most popular use cases for server-side Google Tag Manager , often shared on this blog, too, is to split an incoming stream into multiple different endpoints . Since the demise of customTask for Universal Analytics (Rest In Peace!), there hasn’t really been a solid, officially supported way of splitting a single GA4 stream into multiple endpoints. This is useful in case you want to…

#GTMTips: Quickly Duplicate Tags In Google Tag Manager

There are many reasons why you might want to duplicate your tags (or triggers, or variables, or templates) in Google Tag Manager. One prime example is server-side tagging , where it’s sensible to first build and validate your tracking setup before migrating fully to a server-side approach. Alternatively, you might want to collect analytics data to a second property, for example when you want…

Cookie Access With Shopify Checkout And SGTM

In this guide, I’ll show you how to add first-party cookie values client-side , which your server-side Google Tag Manager processes can then access. You might be wondering: “Why bother?”. After all, if server-side GTM is running same-site with the website sending the requests, why can’t it just read the cookies on its own, right? Well, true. But there are cases where the…

GA4 to Piwik PRO Using Server-side Google Tag Manager

There are two new custom templates available in server-side Google Tag Manager . These templates have been designed to facilitate Piwik PRO tracking in a server-side container. Piwik PRO Client -> This Client template interacts with the Piwik PRO JavaScript tracker and lets you route Piwik PRO tracking through a server-side GTM container. GitHub repo . Piwik PRO -> The tag template works in unison…

New Piwik PRO Templates In Server-side Google Tag Manager

Piwik PRO has two new server-side Google Tag Manager templates, and this article explains what they are and how they work. The first template, Piwik PRO Client , is designed to work in unison with the Piwik PRO HTTP API . Most often these requests are generated by the Piwik PRO JavaScript tracker, but theoretically any HTTP source that uses the same schema can send requests for the Client to…

First-Party Mode For Google Tags

Google has released a new feature, First-Party Mode (FPM), into public beta. Image source First-Party Mode seeks to make it easier to wrap Google’s measurement and advertising technologies in a first-party, same-origin context. This means that the user’s browser, when visiting a website running FPM, would no longer communicate directly with Google’s domains when fetching…

#GTMTips: Automatic Page View Hits In SGTM After Consent Granted

If you’re using server-side Google Tag Manager , Google (Advanced) Consent Mode and you’re collecting hits to Google Analytics 4, you might have noticed something odd happening when switching consent to granted state. It looks as if your page_view hits as well as any other hits marked as “Conversions” (or key events now, I guess) are automatically redispatched to the…

#GTMTips: Consent Granted Reprocesses Previously Denied Hits

This will be a quick tip, but it’s here to correct my previous statements in the comments section of different articles on this blog. When using Advanced Consent Mode , Google Analytics 4 collects hits when consent is in "denied" state. These hits have a lot of parameters stripped off them, including identifiers like the Client ID and the Session ID . The hits will not surface in reports…

The Technical Marketing Handbook By Simmer

Simmer has just released the Technical Marketing Handbook . It’s a free online resource, formatted as a mini-course, designed to walk the reader through the different disciplines and concepts that fall under the banner of “technical marketing”. And yes, we spend the introductory chapter explaining what that term means to us. In total, we wrote 9 chapters , each with 3 topics ,…

Consent Mode V2 For Google Tags

**Last updated March 7, 2024. Clarified that you do NOT need to resend hits when consent is granted, if those hits were collected on the same page when consent was denied. Google’s Consent Mode continues to be a hot topic, especially since in 2024 it will be required to implement Consent Mode in case a website or app is collecting data for audience building or remarketing with Google’s…

Thoughts On Education

As my LinkedIn inbox graciously reminded me that I’ve been working on Simmer for a full three years now, I’d like to share a couple of observations about education – particularly in the world of technical digital marketing. Online courses are an interesting vehicle for education. The medium offers a plethora of different approaches to knowledge transfer, student assessment, and…

Consent Mode (Google tags) - Custom Tag Template

This is a template for deploying Google tags’ Consent Mode functionality. It lets you deploy Consent Mode with both the “default” and “update” commands.

Join Google Ads And GA4 Data In Google BigQuery

I am fortunate to share another guest post by Arben Kqiku , Digital Analyst at Assura . Last time, Arben graced this blog with a comprehensive love letter to R as an example of the power of this programming language. This time, he’ll add even more fancy tools to the toolkit to help you build a data pipeline in the Google Cloud Platform to join your Google Ads and Google Analytics 4 data…

Cloud Run With Server-side Tagging In Google Tag Manager

In a recent update to server-side tagging in Google Tag Manager , Google switched the default deployment of a server-side tagging backend from Google App Engine to Google Cloud Run . Now, when you create a new container and choose the automatically provisioned tagging server option, this service will be created in Google Cloud Run instead of in Google App Engine. While I’ve written about…

The Google Tag Template In Google Tag Manager

Google is going all-in with Google Tag . We’ve already seen the consolidation effort through products like Google Analytics 4, and now Google is extending the merging of the tagging stack into Google Tag Manager, too. I’m referring to the new Google Tag that has replaced Google Analytics 4 configuration tags in your Google Tag Manager containers. With this release, all your old GA4…

Settings Variables For GA4 In Google Tag Manager

One of the big pain points in configuring Google Analytics 4 through Google Tag Manager has been the difficulty of setting up event parameters, user properties, and settings across a range of tags. Well, we can finally get rid of our clumsy Config tag sequencing hacks because Google has released two new settings variables that mimic how the Google Analytics Settings Variable used to work in…

Thank You

Today marks the date of exactly 10 years of marriage to my wife, my friend, the loving mother to our children, and my business partner at Simmer . And yes, they are all the same person – I’m that lucky! Thank you, Mari , for everything.

Just Breathe

Content warning: introspection, parenthood, “Floating Butt”. When Benjamin (our first child) was born, my life as an individual was unraveled. With every bellow from the newborn’s lungs, I could feel my personal agency slipping away from me. From that magical moment onwards, I’ve been gripped by the polarizing emotions of parenthood. At any given time, I’m galvanized…

Transformations In Server-side Google Tag Manager

In January 2020, when Google Tag Manager’s server-side tagging was first introduced to the general public at SuperWeek , I wrote a flurry of tweets , sharing my vision of a server-side tagging future. In one of the tweets, I discussed how you could do these: Hit validation and fixing before the hit is sent to the endpoint PII and privacy controls for the requests before dispatch Fast forward…

Dear Google Analytics 4

I owe my career to Google Analytics. Whatever success I have achieved over the past 15 years or so can be directly attributed to my work with GA and, by extension, other tools in the Google stack. Now, Universal Analytics is about to be turned down . It fills me with a sense of nostalgia and pining for past, simpler times. When I cast my mind back, a scattering of memories emerges in my mind:

#GTMTips: Prevent SGTM From Setting The FPID Cookie

The FPID cookie is what server-side Google Tag Manager would prefer to use for your Google Analytics 4 tracking. It’s a cookie set in the HTTP response from the server, and it’s flagged as HttpOnly , which means it’s only accessible by a web server running on the domain on which it was set. There’s nothing wrong with the technology, and I do recommend that server-side…

#GTMTips: Override Google Analytics 4 Fields In Server-Side GTM

Server-side tagging is all about control . Being able to intercept, modify, and even block requests as they come in before they are dispatched to their actual endpoints is extremely valuable. The built-in Google Analytics 4 tag template has options for modifying event parameters and user properties in the Google Analytics 4 request, but did you know you can use these options to modify some of the…

DebugView With GA4 Measurement Protocol

While Measurement Protocol for GA4 is still rather, well, rough, it can be used to augment existing collection quite nicely. Recently, I wrote an article that discussed the nuances of session attribution with Measurement Protocol. One of the pain points of any data ingestion setup is how to debug it . Measurement Protocol hits are not automatically surfaced in GA4’s DebugView . In this…

Session Attribution With GA4 Measurement Protocol

In this article, I’ll try to clarify the understandably murky Measurement Protocol functionality in Google Analytics 4 . Measurement Protocol is a way to send events to Google Analytics 4 directly from a machine capable of sending HTTP requests (such as a web server). It’s an alternative collection method to the client-side libraries of Google Tag and the Firebase SDK . Measurement…

Track And Categorize All Link Clicks On The Site With Google Analytics 4

This is a guest post by Sebastian Pospischil , Evangelist Digital Analytics at TRKKN . All credit for the solution goes to him. The Summary section is the only one authored by Simo Ahava. You know the deal. Each and every day, clients reach out to you asking for custom click tracking for this call-to-action on that slider, or that button in this section of a page. They reach out to you because…

Expiration Cap Removed From JavaScript Cookies In WebKit Browsers

If you recall, in February 2019, Apple published a post on the WebKit blog , which introduced version 2.1 of their Intelligent Tracking Prevention browser mechanism. In this version, Safari (and soon all WebKit browsers, including browser apps on iOS and iPadOS) placed an expiration limit on browser cookies set with JavaScript. It was no longer possible to set the expiration date further than 7…

Agency, Transparency, And Control: Unsolved Problems With Server-side Tagging

I have been a strong supporter of server-side tagging , in particular Google’s server-side tag management solution . I admire the way it seeks to readjust the balance of control that typically has been in favor of the marketing vendors whose JavaScript libraries have been free to wreak havoc in the user’s browser. By inserting a buffer between the user and the vendor, the owner of the…

Content Analysis With GA4, BigQuery, R, Sheets, And Data Studio

This is a guest post – the first one in a long time! The foreword and summary are written by me, Simo, and the rest is by my esteemed guest author. How fortunate was I to have been contacted by Arben Kqiku , Digital Marketing & Data Manager from comtogether . Arben is one of our many Simmer students, and he’s walked through the Query GA4 Data In Google BigQuery course, learning a lot along…

#GTMTips: Use GA4 Schema In Universal Analytics Ecommerce

With the sunset announcement of the Universal Analytics service, it certainly does seem like a waste of time to write articles about it. However, a recent update to Google Tag Manager is an interesting one and should provide relief to those Google Analytics users who are set on double-tagging their sites for both Universal Analytics and Google Analytics 4 and who want to make use of GA4’s…

One Tag To Rule Them All: Introducing The New Google Tag

For the longest time, Google has been working towards consolidation of their products to build a unified tagging platform . Products that are instrumented (or associated) with “tags” would fall under this umbrella. These comprise tools like Google Tag Manager , Google Ads , Google Optimize , and, of course, Google Analytics . If you’ve been peeking under the hood, you might have…

#GTMTips: Preflight Requests in Server-side Google Tag Manager

With certain types of HTTP requests , the web browser might first dispatch a request with the OPTIONS method, also known as a preflight request . The purpose of the preflight request is to “check” with the web server that it’s equipped to handle the type of cross-origin request the browser wants to dispatch. If the server doesn’t handle this preflight request, or if it…

#GTMTips: Preview Requests In Server-side Google Tag Manager

Server-side Google Tag Manager has an excellent Preview mode , which lets you inspect incoming requests , monitor the event data object , view console messages , and identify outgoing requests , among other things. To enable this Preview mode on the web, you simply need to click the Preview button in the container, after which any requests sent from the same browser instance will be automatically…

10 Truths About Data - Revisited

Seven years ago, I wrote on my former employer’s (the amazing Reaktor ) blog a tongue-in-the-cheek article titled 10 Truths About Data . Looking back on it today, I’m still proud of the handiwork, but I can’t help but think that some of the truths were wasted just to reach the magic number 10. So, today, I want to revisit these truths and provide a rehashed version for you, my…

#GTMTips: Setup IAM For Manual Installation Of Server-side GTM

If you want to manually install server-side Google Tag Manager on App Engine in the Google Cloud Platform, you are of course welcome to do so. The main benefits of doing this are that you get to choose the region where App Engine is deployed and that you can use existing project resources instead of having a new project automatically created for you. However, to run the script without errors,…

Enrich Server-side Data With Cloud Firestore

With asynchronous variables recently released in server-side Google Tag Manager , it’s time to dig into data enrichment flows using another release from the Google team. * drum roll * We have a new Google Cloud Platform API! It’s fast. It’s sleek. It’s beautiful. It’s Firestore ! Firestore is a NoSQL , transactional , and scalable database that offers near-real-time…

Asynchronous Variables In Server-side Google Tag Manager

OK, that’s one unappealing title for a blog post, but rest assured that the content more than makes up for this obscurity. Recently, my favorite toy in the world, Google Tag Manager’s server container , introduced the capability to handle asynchronous operations in variables. This is done through a JavaScript interface known as Promise . A Promise is a way to run code in JavaScript…

#GTMTips: Setup A Google Tag Manager Server Using Cloud Run

While Google App Engine , the default implementation pattern of server-side Google Tag Manager , is straightforward to setup with the automatic provisioning steps , it’s certainly not the only way to deploy the server. You can set it up in Amazon AWS (this blog) You can set it up in Microsoft Azure (this blog) You can set it up with Cloud Run ( Mark Edmondson’s blog) In fact, the…

Debug Guide For Web Analytics And Tag Management

One of the key skills for anyone working with web analytics and tag management is understanding how to identify where things went wrong, why they went wrong, and ideally how to fix them. There are plenty of excellent browser extensions for helping you debug, and we’ll discuss these in the guide, too. But most of all we’re going to use browsers’ own developer tools , as they are…

#GTMTips: Manipulate Response Headers In Server-side Google Tag Manager

Although most of Server-side Tagging in Google Tag Manager revolves, quite rightfully, around Clients , there’s still plenty of value to be derived from tags , too. Naturally, the most common use case for server-side tags is to map the incoming requests to the Server container (filtered through Clients) and dispatch them to their respective endpoints. But in addition to dispatching HTTP…

Server-side Tagging With Azure App Service

To continue my extensive collection of Google Tag Manager’s server-side tagging articles , in this guide I’ll walk you through how to set up a Server container in Microsoft Azure’s App Service platform. For my previous guides on manually provisioning a Server container, follow these links: Amazon AWS (Elastic Beanstalk): Deploy Server-side Google Tag Manager In AWS Google Cloud…

#GTMTips: Cross-domain Tracking In Google Analytics 4

Setting up cross-domain tracking in Google Analytics 4 has been well-documented . The main departure from Universal Analytics is how cross-domain measurement is something you configure through the Google Analytics user interface rather than through implementation and JavaScript. While this approach is obviously beneficial especially for those who lack the know-how or the resources to configure the…

Measure Ad Blocker Impact With Server-side GTM

For many, it seems, one of the most important justifications for server-side Google Tag Manager is its resilience to ad and content blockers . After all, by virtue of serving the container JavaScript from your own domain , you escape many of the heuristic devices today’s blocker technologies employ. Well, I’ve gone on record over and over again to say how this is poor justification for…