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 already set up GA4 in the web container? Then proceed 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 will take you through the steps required to install GA4 in the web container. This is the first step of 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 that you have already created a Google Tag Manager account. If you are looking for a description of how to create a Google Tag Manager account, check out this article. In addition, we will 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 via management > data streams > click on the stream. No account yet? Create one first.
2. Create a new tag (Web Container)
Go to the web container in Google Tag Manager. Go to "Tags. and then click on "New.
3. Tag configuration (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 Tag? 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!
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. The choice of Initialization instead of All pages is made 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 receive events and utm paramters are forwarded to the server container first. When you only have all pages the tags sometimes fire later causing you to miss ga4 events.
Nice going, you now have GA4 installed in the web container! Don't forget to put the container live, by clicking send in the upper right corner.
This set up allows you to send all basic events to GA4 via the web container, but of course we want more. We want to track all important events server side. In the next blog you will learn how to measure custom events, such as a purchase, with GA4. In the blogs after that you will learn how to measure these server side.