taggrs-logo

How to create a GA4 tag in the server container?

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

workspace-google-tag-manager-triggers

Go to your server container in GTM. Don’t have a server container configured in GTM yet? Then check out this guide.

Step 2: choose type of trigger

choose-trigger-type-google-tag-manager

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

Step 3: set up trigger configuration

trigger-configuration-ga4-client-tag

Select ‘Some events’ under ‘This trigger fires on’. Then enter: ‘Client name – equals – GA4’. Name the trigger and click “Save.

Step 4: create new tag

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

Within your workspace, go to “Tags” and click “New.

Step 5: choose type of tag

choose-tag-type-google-tag-manager

Click ‘Tag configuration’ and choose ‘Google Analytics: GA4’ as the tag type.

Step 6: set trigger

choose a trigger google tag manager

For trigger, select ‘GA4 Client’ (which you just created) and click ‘Save’

Step 7: Testing.

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.

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.

Ready for the next level?

Start with Server Side Tracking and generate more revenue and conversions in a world without third-party cookies.