Logo of TAGGRS, written in blue and with a small favicon
HomeServer-side TrackingMeta CAPI Gateway
Introduction
Get started
Get started with TAGGRSSet up Google Tag ManagerAdd the GTM Data LayerConfigure GTM transformationsTest the setupDebuggingAnalytics dashboard
Migrate from Google CloudMigrate from hosting
Shortcuts
GTM Copy PasteReady-made templates
GA4 Server-side Tracking
Setup in GTMCreate GA4 Event TagsGA4 tag setup in server containerE-commerce events in GTM
Google Ads Server-side Tracking
Install Conversion LinkerSet up Conversion TrackingConfigure Enhanced ConversionsDeploy Remarketing Tags
Facebook Server-side Tracking
Set Meta PixelImprove your EMQ ScoreInstall Meta CAPIMeta Events Deduplication
LinkedIn Server-side Tracking
Install LinkedIn Insight TagSet up LinkedIn CAPILinkedIn Events Deduplication
TikTok Server-side Tracking
Set up TikTok PixelInstall TikTok Events APITikTok Events Deduplication
Pinterest Server-side Tracking
Set up Pinterest TagConfigure Pinterest Conversions APIPinterest Events Deduplication
Snapchat Server-side Tracking
Set up Snap PixelSnapchat Conversions APISnapchat Events Deduplication
TAGGRS Tracking Tags and Tools
Tracking TagsGoogle Service Account integrationsGTM LogsProfit TrackingData Enricher ToolWebhooks TesterEnhanced Tracking ScriptMulti Domain ToolClick ID RecoveryConsent Tool
Configurations
Billy Grace Server-side TrackingLeadPages Server-side TrackingPiwik PRO Server-side TrackingCDN Server-side TrackingShopify Server-side TrackingActiveCampaign Server-side TrackingKlaviyo Server-side TrackingSpectacle Server-side Tracking
Server-side Tracking for e-commerce
Shopify Data LayerShopware Data LayerMagento Data LayerWooCommerce Data LayerPrestashop Data LayerLightspeed Data Layer
Consent Management server-side
Activate Consent ModeConfigure TAGGRS with Axeptio

Install GA4 tags in the server container

Once you've created your GA4 tags, you can configure them in the server container. This guide explains the step-by-step process to set up the GA4 tags, so your events from your server container are correctly dispatched.

Prerequisites

  • a GTM server container
  • a web container already configured to send GA4 events to your server container endpoint

    (using the server_container_url parameter)

  • a GA4 Measurement ID and property ready

Set up the GA4 client in the server container

The GA4 client is responsible for intercepting incoming GA4 HTTP requests and parsing them into event data objects for further processing.

  1. Open your GTM server container.
  2. Go to Clients in the left menu.
  3. If the GA4 client does not exist, click New and select Google Analytics: GA4 as the client type.
  4. Configure the client settings:
    Default GA4 paths
    Keep enabled to capture standard GA4 event requests, such as /collect or /g/collect.
    Default gtag.js paths for specific IDs
    Enable if you want your server container to serve the GA4 JavaScript library through your domain. List your Measurement IDs as needed.
    Automatically serve all dependent Google scripts
    Recommended to keep enabled for seamless script loading.
    Compress HTTP response
    Enable for optimized network usage.
    Enable region-specific settings
    Optional, for advanced consent and privacy controls.
    Cookies and Client Identification
    Use "JavaScript Managed" by default, or configure server-managed cookies if you have set up a custom domain.
  5. Save the client configuration.

Create a GA4 tag in the server container

The GA4 tag will receive event data from the GA4 client and forward it to your GA4 property.

  1. In your GTM server container, go to Tags and click New.
    Create a new tag in Google Tag Manager
  2. Click Tag Configuration and select Google Analytics: GA4.
    Choose the tag type in Google Tag Manager to set up the tag and the triggers for GA4 server-side tracking
  3. Leave fields at their default values unless you need to customize event forwarding (the tag inherits Measurement ID and parameters from the client).
  4. Optionally, add custom mappings or parameter modifications as needed for your analytics strategy.

Set the trigger for the GA4 Tag

  1. In the tag settings, click Triggering.
  2. Click the + icon to create a new trigger.
    Set a new trigger in Google Tag Manager (server container) for your Google Analytics 4 server-side tracking
  3. Choose Custom as the trigger type.
    How to set up the trigger in the server container (Google Tag Manager) for Google Analytics 4
  4. Set the trigger to fire on events generated by the GA4 client:
    • Under conditions, select Client Name equals GA4.
    • This ensures the tag only fires for events parsed by the GA4 client.
  5. Save the trigger and tag configuration.

Test your server-side GA4 setup

  1. A client allows for processing incoming requests sent from a Google Analytics 4 client. This is often automatically added to the server container, but not always. To check if you have a GA4 client, go to Clients in the server container and this client should be listed here. No GA4 client yet? Create one. You can keep the above settings. Make sure to add your own Measurement ID.  
    After the setup of GA4 tags and triggers in Google Tag Manager, verify if the client is set up
  2. Use the Preview mode in your GTM server container to simulate incoming events.
  3. In your browser, trigger events on your website (e.g., page views, purchases).
  4. In the server container preview, verify that:
    • The GA4 client claims the incoming requests.
    • The GA4 tag fires as expected.
    • Events are dispatched to your GA4 property (check GA4 DebugView or Realtime reports).
    Check if your GA4 tag fires the events correctly in Google Tag Manager's Preview mode
  5. For additional validation, append /healthy to your server container URL in a browser to check server health (should return ok).

Best practices

Parallel measurement
During migration, use dual-tagging to compare client-side and server-side data before fully switching to server-side only.
Hybrid collection
You can choose to send some events directly to GA4 and others through the server container for flexibility.
Custom domains
Proxy the GA4 script and event requests through your own domain for improved first-party data and tracking resilience.
Privacy controls
Leverage region-specific settings and custom parameter filtering for privacy compliance

Troubleshooting

Events not received in GA4
Confirm web container is sending to the correct server_container_url and triggers match
Tag not firing
Check trigger conditions and client configuration
Data mismatch
Use parallel measurement to compare and debug discrepancies
Script loading issues
Ensure dependent scripts are allowed in GA4 client settings

Useful resources

Google Analytics 4 logo in white
Where to find your Google Tag
icon of a white upward arrow
Google Analytics 4 logo in white
Read the full manual on GA4 Server-side Tracking
icon of a white upward arrow
icon of a white thunder used by TAGGRS to visually introduce Server-side Tracking
Start for free with Server-side Tracking
icon of a white upward arrow
White silhouette of a person used as icon for the support call to action
Get expert support
icon of a white upward arrow
Previous
Create GA4 Event Tags
Next
E-commerce events in GTM
DOCUMENTATION V1.3
Copyright © 2025 TAGGRS. All right reserved.
TABLE OF CONTENTS
PrerequisitesSet up the GA4 clientCreate a GA4 tag in the server containerSet the triggerTest your setupBest practicesTroubleshootingNext stepsUseful resources