Parallel Measurement: Dual-Tagging for Server-Side
A server container can digest any type of HTTP request dispatched from an online source. However, the recommended way of collecting data is through a Google tag or a gtag.js event running in the web browser.
If you already have a Google Analytics 4 (GA4) tracking setup on your website, it’s important to keep it as it is for now. Don’t rush to change your current setup to send data to the server container just yet.
Instead, start by setting up a new GA4 property for server-side dispatch. This allows you to copy the existing tags one-by-one, and build towards a dual-tagged GA4 setup on the website. By doing so, you can ensure you're collecting data for both client-side and server-side hits simultaneously.
Dual-tagging refers to duplicating your existing GA4 tags to track data in two separate properties:
- One property for client-side data collection.
- Another property for server-side data collection.
This way, you're collecting data in parallel, allowing you to compare both methods and ensure accuracy before fully transitioning to server-side measurement.
If your goal is to eventually move all data collection to the server container, you need to wait until the server-side setup reaches parity with the client-side setup. Once the data matches up and you’re confident in your server-side tracking, you can modify the tags to only collect data through the server container, removing the dual-tagging setup.
You don’t have to send all data through the server container. Many websites use a hybrid approach, where some data is collected directly from the browser and some passes through the server container. This type of collection is very common and can help balance performance and data control.
By following this approach, you’ll ensure a smoother transition to server-side measurement, while keeping your data collection accurate and consistent during the process.