Stape

How to set up Google Analytics with Google Tag Manager Server-Side Container?

Updated
Mar 3, 2022
Published
Oct 7, 2020

Google Tag Manager server container has close integration with Universal Analytics. When you set up GTM server tagging, you will see that Universal Analytics Client is created by default. In this article, we will discuss the benefits and possibilities that server-side Google Analytics offers. And also, how to configure Google Analytics in your Google Tag Manager Server account.If you don’t have a GTM server container yet, please follow this instruction on how to launch it on your website. If you are still not sure what GTM server tagging is and how it can benefit your website tracking system, please read this blog post.

universal analytics stops working

What are the benefits of implementing Google Analytics Server-Side tracking?Copy link to this section

1. Bypass Ad Blocker and ITPsCopy link to this section

There are two ways of implementing Google Analytics within a server-side container: host it on your subdomain or our domain. Hosting on your subdomain gives you the massive benefit of bypassing AdBlocker and Intelligent tracking preventions. A custom subdomain feature is not available in a free plan, so you’ll need to update to one of the paid plans; please check our pricing.

In 2020, roughly 27 percent of internet users are using ad blockers. It means that a bit more than a quarter of paid ads will never reach their audiences. And this number is expected to grow by 2-3% annually. 

Not only ad blockers prevent your tracking from collecting all data about website visitors. Some browsers are now using Intelligent tracking prevention technology, which is designed to stop 3rd party cookies. Firefox launched it in 2019; Safari began using ITP in autumn 2020. Though Chrome still has not announced anything similar to ITP, it started blocking third-party pixels by default in the incognito mode.

betterbuild and incognito mode

Let’s say your website visitor agreed to the cookie policy but he is using an ad-blocking extension. In addition to blocking display ads, it will also block all the requests that are sent to Google Analytics. In this case, GA doesn’t receive any information; you won’t be able to see this user’s data and remarket him when he is browsing other websites.

user's data

With server-side tagging, you could create a tagging URL within a custom subdomain that is located in the same hierarchy as your website domain; for example, gtm.yourdomain.com. In this case, collect requests will be sent not to google-analytics.com, but your gtm.yourdomain.com. This way, you will make GA request the first party, and it would not be blocked by ITPs and AdBlockers. 

custom subdomain

Safari and Firefox are limiting the cookie lifetime to 7 days or, in some cases, to 24 hours. It means that unless a user is revisiting your site every day and cookies are continuously updated, it will expire in 1 or 7 days. And Google Analytics will record these visitors as new. There is a website that helps you to track the latest information about browser storage updates.

Currently, the only way to avoid this is to run Google Analytics via Server-Side Google Tag Manager. This feature is enabled by default, but we recommend checking it to be 100% sure that cookie lifetime is set up to a more extended period.

universal analytics server managed

How to Set Up Google Analytics Inside Google Tag Manager Server-Side Container?Copy link to this section

1. Create Google Tag Manager Server-Side container if you haven’t created one. Please follow these instructions. 

2. Add a custom subdomain if you want to bypass adblockers and increase cookie lifetime. Follow these instructions

3. Make sure you’ve changed the tagging URL inside your Google Analytics variable within Google Tag Manager Web Container. Inside Google Tag Manager Web Container, go to Variables -> Choose your Google Analytics variable -> More Settings -> Advanced Configuration -> Past Transport URL.  

google analytics advanced configuration

4. Set up Universal Analytics Tag inside GTM Server Container. Open the “Tags” section inside Server-Side GTM Container and Click “New.”

Name Your Tag, choose tag type “Universal Analytics.”

Create a trigger. Trigger type “Custom,” choose “Some Events.” Client Name equals Universal Analytics. 

You might not see the Client Name variable in the dropdown. In this case, open the Variables tab, click Configure, and enable all variables.

Click Save.

universal analytics tag permission
universal analytics some events
configure variables in tag manager

5. Now let’s open the preview mode of your server Google Tag Manager and make sure that it sends events to Google Analytics. You should see your standard pageview event and custom events that you send via web GTM.

tag manager summary 

That’s it! Now your Google Analytics runs via server container. Please let us know if you have any questions or need clarifications about implementing server Google Analytics. 

We can set up server-side Google Analytics for you!

You only have to click Get help, fill up the form, and we will provide assistance you needed.

Get help

Relevant posts

Updated Oct 24, 2022

3 Easy Steps to Test Server-Side Universal Analytics/GA4 and Facebook Conversion API

Google released a Server-Side version of Google Tag Manager in 2020. Server-side tracking is more complicated than the web container set up, at least for now, since the idea and technology behind server tagging are entirely different from what we used to have on the web. But server-side tagging will give your site huge benefits. Server-side tagging is getting more popular due to its ability to track people using AdBlockers, browsers with ITPs, and other tracking restrictions. The purpose of this article is not to convince you to start using server-side tagging (there is another blog post that describes the main benefits of server-side tracking). I assume that you’ve already decided to implement server-side tagging on your site. This blog post will show you how to check whether Server-Side tracking for Universal Analytics, GA4, and Facebook conversion API was set up correctly.

Updated Feb 23, 2024

Google tag manager server-side: How to set up server Tag Manager, Universal Analytics, GA4, and Facebook conversion API

Server-side tagging has been one of the main trends in web analytics for the last couple of years. Ad blockers, Intelligent Tracking Protection, 3rd party cookie restrictions, regulations like GDPR made analytics and advertising companies start worrying about how and what information they collect about site visitors. Server-side tagging allows moving third-party tags off your site and into a cloud server. In this case, third-party pixels are loaded directly from the could server rather than your site. In this article, I will explain and demonstrate the basics of setting up Google Tag Manager server container, server Universal Analytics, GA4, and Facebook Conversion API.

Updated Oct 24, 2022

How to prevent your Google Analytics data from being blocked by ad blockers

You’ve probably noticed that data about your website users and conversions collected by different analytics tools might vary. Most of the time, you’ll see that the purchase number in Google Analytics is lower than in your CRM. Where this data discrepancy comes from, why is it happening, and how to fix it?

Host your GTM server at Stape