Articles on: Server Side

Set up a GA4 tag on your sGTM container

When setting up Google Analytics 4 (GA4) with a server-side Google Tag Manager (sGTM) container, data flows from the web container to the server container before being sent to GA4. The Google Tag in the web container first collects data and sends it to the GA4 client in the server container. From there, the GA4 Tag processes the data and forwards it to different channels (tags) for tracking and analysis.

In this guide, we will walk through the correct way to set up the GA4 Tag on the server container. This setup ensures that data is processed efficiently and accurately before reaching GA4. If you are using AdPage Tagging, it includes a default DataLayer user object, which simplifies integration when following AdPage’s recommended steps. By configuring GA4 properly in the server container, you can improve data accuracy, enhance privacy controls, and optimize your analytics setup.

Let’s get started 🚀

Create GA4 Tag



To effectively track user interactions and events on your website, it’s essential to create a Google Analytics 4 (GA4) tag within the server-side Google Tag Manager (sGTM) container. This tag acts as a communication bridge, sending event data from your site to Google Analytics for further analysis.

Setting up a GA4 tag ensures accurate data collection, enabling you to gain valuable insights into user behavior, optimize marketing efforts, and improve your overall digital strategy. In this section, we’ll walk you through the steps to create a GA4 tag using the sGTM container



Configure Trigger for GA4 Tag



After creating your GA4 tag, you need to configure a trigger to determine when the tag should fire. Triggers are essential for controlling the specific conditions under which your GA4 tag is activated.



If you are using Purchase webhooks, make sure to exclude the "Purchase" event name from being triggered or processed. This is important to avoid duplication or unnecessary tracking of purchase events, ensuring your webhook functions as intended without collecting redundant data.

Purchase Webhooks

Updated on: 05/02/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!