Clarification on Google Analytics Server-Side Setup

I have several doubts regarding the implementation of GA4 on the server side.

From what I understand, it is incorrect to send events from both the browser and the server to the same data stream, as GA4 does not handle de-duplication like META does.

To properly set up GA4, should I use two different streams within the same property, or should I use two separate properties?

Thank you

You do not need to do this. GA4 in server side format works as a proxy. The data is not changed in any way, nothing happens to it (unless you have specially configured it, which is usually very rarely done), web requests are simply redirected further to GA4 from the server.
If you just add a new property and tags for it in parallel with the web - you will get bad results because GA4 is not designed to run multiple properties in parallel, especially if one of them is server-side and the other is client-side.

You can find more information in our article: How to set Up GA4 tracking using GTM server-side container - Stape

Thank you for the response. Please help me clarify some aspects.

My GA4 Web Tag includes a parameter called ā€œserver_container_urlā€ with my Stape server.

In this case, does the web tag still send data to the Analytics servers and also pass the information to Stapeā€™s client server, or does it only send the data?

I canā€™t understand whether Iā€™m sending the data once or twice.

Looking at the web network events, it seems that the data is being sent twice, but Iā€™m very confused about it.

If you have everything configured correctly, it does not send data to analytics directly, but sends data to the server, after which this data goes further to GA4 analytics from the server.

With the correct configuration, you send the data once from the server.

If you see that events go directly to the analytics and to the server in the network, you have incorrect settings. Most likely, you have an additional gtag snippet that can overwrite the main one. This is the reason why parallel (web and server) GA4 tracking is a bad practice.

Thank you for the clarification.

In practice, with a correct setup, the GA4 Web tag should pass the data to the Client server, which sends the information to the servers. Consequently, the data is sent only once, exclusively server-side.

I will review my setup. Currently, I have only one GA4 tag.

I take the opportunity to ask you: Stape recommends using ā€œserver_container_url,ā€ while others use ā€œurl_transportā€ for server-side configuration.

What is the difference?

you should use ā€˜server_container_urlā€™. It is recommended parameter from GA4.

Can you share with me the source of the recommendation? I canā€™t find useful documentation.

You can checkout this Google official document:

Thank you very much. I was unable to fint this documentation myself for some reason. You are very kind! I will study it very soon.

2 Likes