Table of contents

How to create a GA4 tag in the server container?

google-tag-manager-on-screen

Curious about the entire overview? Then check out GA4 Server Side Tracking setup page?

In the previous blog, we showed how to create a GA4 event tag in Google Tag Manager. By setting it up, we can send the data and e-commerce events to the server container. There they are automatically retrieved by the GA4 data client. For Google Analytics 4 to work server side, it must also be configured as a tag in the server container. In this blog we explain step by step how to configure this tag.

GA4 tag creation in the server container

ga4-tag-setup-server-container-google-tag-manager

GA4 tag creation in the server container

Total Time: 5 minutes

Step 1: create new trigger (Server Container)

workspace-google-tag-manager-triggers

Step 1: create new trigger
Go to your server container in GTM. Don't have a server container configured in GTM yet? Then take a look at this guide. Go to Triggers and click New.

Step 2: choose trigger type (Server Container)

choose-trigger-type-google-tag-manager

Click the pencil under Trigger Configuration and choose Custom as the trigger type.

Step 3: set up trigger configuration (Server Container)

trigger-configuration-ga4-client-tag

Select Some events at This trigger is triggered for. Enter: Client name - equals - GA4. Name the trigger and click Save.

Step 4: create new tag (Server Container)

create-new-tag-server-container-google-tag-manager

Within your workspace, go to tags and click new.

Step 5: choose tag type (Server Container)

choose-tag-type-google-tag-manager

Click Tag Configuration and choose Google Analytics: GA4 as the tag type. Enter your GA4 Measurement ID, the same as for the web container GA4 tag. Under Event Name, select the variable Event Name. Next, under Trigger, select the GA4 Client you just created.

Step 6: set up trigger (Server Container)

choose a trigger google tag manager

Under trigger, select GA4 Client and click Save

Step 7. Check if the client is set up (Server Container)

create-ga4-client-gtm

A client allows for processing incoming requests sent from a Google Analytics 4 client. This is often automatically added to the server container, but not always. To check if you have a GA4 client, go to Clients in the server container and this client should be listed here. No GA4 client yet? Create one. You can keep the above settings. Make sure to add your own Measurement ID.

Step 8: Testing (Server Container)

server-container-preview-mode

In preview mode, see if the GA4 Tag is being fired. Is it fired in the Web Container but not in the Server Container? Then check if the Measurement ID (Web Container) and the Tag ID (Server Container) in the GA4 Configuration tags match.

Don't forget to put your container live!

Congratulations!!! You have completed the entire GA4 server side deployment sequence. Don't forget to put the server and client container live and, of course, test everything extensively. In this series we have assumed a standard situation. But of course there are always differences per website. Therefore, always use the preview mode to test each event properly.

Note: GA4 has a delay, so it may take 24-48 hours before the events are actually visible in the e-commerce reports.

What's next?

You can think of GA4 as the artery of your server side tracking. But an artery has all kinds of branches. The same is true in this situation. You can use the GA4 data for all kinds of server side tags. Think of Google Ads remarketing, tracking conversions with Google Ads and the Meta Conversion API.

About the author

Recently published

magnifiercrossmenu linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram