Insights

Setting Up Server Side Tags In Google Tag Manager

Server-Side Tracking In Google Tag Manager

Google introduced server-side tagging in 2020. By implementing a server container in Google Tag Manager (GTM) in conjunction with your existing web containers, you can measure user activity on your website wherever it happens. Make sure you familiarize yourself with what Google Tag Manager server-side tracking is and its benefits, before proceeding with the tag configuration, to make sure its right for your website needs.

If you haven’t had a chance to set up your GTM server container and Google Cloud Platform (GCP), read our blog here.

The tagging configuration we will cover in our blog, involves setting up the following:

Client Container Configuration

1. After setting up your GCP, open the Server container in GTM and go to the Admin tab

Screenshot of admin tab in Google Tag Manager

2. Go to User Management and confirm you have Publish permissions in the server container

Screenshot of server-side tagging in Google Tag Manager permissions

3. Return to your GTM workspace and navigate to the Clients tab in the left-hand menu

Screenshot of server-side tagging in Google Tag Manager client menu

4. Click New to create our GA4 client

5. Name your Client Configuration “GA4”

6. Click on the Client Configuration area to open the different Client Type options

7. Select the Google Analytics: GA4 client option

Screenshot of Google Tag Manager client configuration

8. Click Save

Variable Configuration

1. Navigate to the Variable tab in the left-hand menu

2. Click Configure in the Built-In Variables section and enable Client Name and Event Name

Screenshot of server-side tagging in Google Tag Manager built-in variables

3. Once both of these variables are enabled, click the “X”

Screenshot of server-side tagging in Google Tag Manager built-in variables

Trigger Configuration

1. Navigate to the Trigger tab on the left-hand menu

2. Click New

3. Name the Trigger - GA4 Server Side Trigger

4. Click the Trigger Configuration area to select a Trigger Type and click Custom

Screenshot of server-side tagging in Google Tag Manager trigger type menu

5. Select This trigger fires on - Some events and have your condition = Client Name equals GA4 to connect it to the GA4 Client we just configured

Screenshot of server-side tagging in Google Tag Manager client configuration

6. Once your trigger configuration looks like this, click Save

Screenshot of server-side tagging in Google Tag Manager trigger configuration

Tag Configuration

1. Navigate to the Tag tab in the left-hand menu

2. Click New

3. Name the Tag – GA4 Tag Server Side

4. Click the Tag Configuration area and click the Google Analytics: GA4 Tag Type

Screenshot of server-side tagging in Google Tag Manager tag type menu

5. Enter your Measurement ID from the GA4 Property’s Data stream

Screenshot of server-side tagging in Google Tag Manager tag configuration

6. Add the GA4 Server Side Trigger we configured under the Trigger Configuration section

7. Click Save

Setting Up Your Configuration Tag

The next step to configuring our server-side tags is to connect our server container with our web container using our GA4 Configuration tag. The GA4 configuration tag connects our GTM container with a GA4 property through a specific data stream’s measurement ID. We also need to indicate the server URL we created in our Google Cloud Platform.

1. Go to your web container and open your GA4 Configuration tag in the web container you want to connect

2. Click the send to server container check box

3. Input the server container URL we configured earlier

Screenshot of server-side tagging in Google Tag Manager tag configuration

4. Click Save

Debugging Your Server-Side Tag

Debugging the tag requires enabling Preview mode in both the web and server containers.

Server Preview Mode

1. Open the server container Preview mode

2. You will notice that the URL of the new tab in your browser https://analytics.getfishtank.ca/ which we set it up in the first section of this work instruction. You should see an empty tag assistant summary dashboard

3. To test our Server tag, we need to open our web container and load the tag assistant to firm our GA4 Configuration tag in GTM to ensure that page load is also being sent to the server container

Web Preview Mode

1. In another tab, open the same property’s web container

2. Click Preview in the Overview section of the container you want to debug

Screenshot of server-side tagging in Google Tag Manager workspace

3. Enter the URL of your website where we are testing the server-side tags

Screenshot of server-side tagging in Google Tag Manager tag assistant

4. The page load itself should be enough to fire the GA4 server-side tag we just configured

Screenshot of server-side tagging in Google Tag Manager tag assistant

5. Return to the server-side tag assistant to check if it fired

Screenshot of server-side tagging in Google Tag Manager tag assistant

In Closing

Server-side tagging introduced a new layer of functionality for measuring events and collecting user data using Google Analytics. The tag configuration we covered in this blog will now allow you to send data from your website to a server on your Google Cloud Platform where a GTM instance is virtually loaded. The complexity of setting up server-side tagging can be intimidating, but our friendly team of Analytics experts are ready to help! Reach out to us at [email protected].

Until then, happy tracking!

👋 Hey Sitecore Enthusiasts!

Sign up to our bi-weekly newsletter for a bite-sized curation of valuable insight from the Sitecore community.

What’s in it for you?

  • Stay up-to-date with the latest Sitecore news
  • New to Sitecore? Learn tips and tricks to help you navigate this powerful tool
  • Sitecore pro? Expand your skill set and discover troubleshooting tips
  • Browse open careers and opportunities
  • Get a chance to be featured in upcoming editions
  • Learn our secret handshake
  • And more!
Sitecore Snack a newsletter by Fishtank Consulting
 

Meet Theresa Gutierrez

Sitecore Strategist | Sitecore Strategy MVP

⛳ 🌮👩🏻‍💻

Theresa, aka 'T', is a high-energy marketing creative with 8+ years of experience across various industries. She's passionate about delivering strategy and design, with a focus on Sitecore SaaS technologies. T is an avid golfer and loving dog momma, appeased only by delicious food and a bevy of something bubbly. Cheers!

Connect with Theresa