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 GA4 event tags in Google Tag Manager. By setting these 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

Go to your u003Cstrongu003Eserveru003C/strongu003E u003Cstrongu003Econtaineru003C/strongu003E in GTM. Donu0027t have a u003Cstrongu003Eserveru003C/strongu003E u003Cstrongu003Econtaineru003C/strongu003E configured in GTM yet? Then check out u003Ca href=u0022https://taggrs.io/en/gtm-server-side-tagging/u0022 target=u0022_blanku0022 rel=u0022noreferrer noopeneru0022u003Ethis guideu003C/au003E.

Step 2: choose trigger type (Server Container).

choose-trigger-type-google-tag-manager

Click on the pencil under u003Cstrongu003Eu0027Trigger Configurationu0027u003C/strongu003E and choose u003Cstrongu003Eu0027Customu0027u003C/strongu003E as the trigger type.

Step 3: Set Trigger Configuration (Server Container).

trigger-configuration-ga4-client-tag

Select u003Cstrongu003Eu0027Some eventsu0027u003C/strongu003E under u003Cstrongu003Eu0027This trigger fires onu0027.u003C/strongu003E Then enter: u003Cstrongu003Eu0027Client name - equals - GA4u0027u003C/strongu003E. Name the trigger and click u003Cstrongu003Eu0022Save.u003C/strongu003E

Step 4: create new tag (Server Container)

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

Within your workspace, go to u0022u003Cstrongu003ETagsu0022u003C/strongu003E and click u003Cstrongu003Eu0022New.u003C/strongu003E

Step 5: Choose tag type (Server Container)

choose-tag-type-google-tag-manager

Click u003Cstrongu003Eu0027Tag configurationu0027u003C/strongu003E and choose u003Cstrongu003Eu0027Google Analytics: GA4u0027u003C/strongu003E as the tag type.

Step 6: set trigger (Server Container).

choose a trigger google tag manager

For trigger, select u003Cstrongu003Eu0027GA4 Clientu0027u003C/strongu003E (which you just created) and click u003Cstrongu003Eu0027Saveu0027u003C/strongu003E

Step 7. Checking that the client is set (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 you can go to Clients within the Server Container and this is where this client should then be. Not a GA4 Client yet? Then create this one. You can keep the above settings. Be sure to add your own Measurement ID.

Step 8: Testing (Server Container).

server-container-preview-mode

In preview mode, see if the GA4 Tags are fired. Is it fired in the Webcontainer but not in the server container? Then check that 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 gone through the entire GA4 server side implementation 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 from one website to another. Therefore, always use preview mode to properly test each event.

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 applies to this situation. You can use the GA4 data for all kinds of server side tags. Consider Google Ads remarketing, conversion tracking with Google Ads and the Meta Conversion API.


About the author

Ate Keurentjes

Ate Keurentjes

Server Side Tracking Specialist at TAGGRS

Ate Keurentjes is a Server Side Tracking specialist at TAGGRS. He has experience with various Google Tag Manager concepts. Keurentjes has been editing and writing about the latest developments and trends in data collection / Server side tracking since 2023.

About the author

Recently published

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