taggrs-logo

How do you set up GA4 through Google Tag Manager in the web container?

To set up server side tagging, it is recommended to start by installing GA4 in Google Tag Manager. Google Analytics 4 (GA4) is the latest version of Google Analytics, which allows you to measure and optimize the user experience on your website using event-driven data.

Have you set up GA4 in the webcontainer yet? Then continue to the next step: creating (E-commerce) Events in Google Tag Manager.

Before you can install GA4 in the server container, it must first be installed in the web container. In this article, we take you through the steps required to install GA4 in the webcontainer. This is the first step of the GA4 server side installation. In the following articles, you will learn how to use GA4 as a“data client” to get all the marketing data into the Server Container. You will also learn how to install GA4 in the server container so that you can eventually use fully server side, Google Analytics.

We assume you have already created a Google Tag Manager account. Should you be looking for a description of how to create a Google Tag Manager account, check out this article. In addition, we also assume that you have already created a server container and configured TAGGRS (steps 4 through 6).

Curious about the entire GA4 Server Side tracking setup? Then check out this page.

GA4 install Google Tag Manager

1. Collect the Measurement ID in GA4 (Web Container)

Open GA4 and select the account you want to install. Go through management > data streams > click on the stream. No account yet? Then create it first.

RcMNX1bdNzM0tMnHv2Ju5GC5DdzhAfCvvNKRmq AAsSi6Kmvd

2. Create a new tag (Web Container)

Access the webcontainer in Google Tag Manager. Go to “Tags. and then click on “New.

workspace-google-tag-manager

3. Tag configuration tag (Web Container)

Give the new tag a name, for example ‘GA4 Configuration’ and click ‘Tag Configuration‘. Choose “Google Tag” as the tag type. Can’t find the Google Tags? Then you are probably working in the server container. Next, enter the Tag ID you created in step 1. Then, under Configuration parameter, enter the following:

  • send_page_view : true
  • server_container_url : [subdomein]

Not created a subdomain yet? Then create a free account with TAGGRS and we will explain to you step by step how it works!

google-tag-settings-ga4-configuration-web-container

4. Fill in the triggers (Web Container)

First, navigate to the Triggers section and select Initialization – All Pages. After adding this option, save the changes by clicking Save in the upper right corner. Initialization instead of All pages is chosen to avoid an increase in unallocated traffic within GA4. This is because Google Tag with the trigger Initialization – all pages is fired earlier. This ensures that you always get events in and utm paramters are forwarded to the server container first. When you only have all pages the tags sometimes fire later so you can miss GA4 Events tags.

trigger-initialization-all-pages

Nice going, you now have GA4 installed in the web container! Don’t forget to put the container live, by clicking send at the top right.

This set up allows you to send all the basic events to GA4 via the webcontainer, but of course we want more. We want to track all important events server side. In the next blog, read how to measure custom events, such as a purchase, with GA4. In the blogs after that, you will learn how to measure this server side.


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.

Ready for the next level?

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