Logo of TAGGRS, written in blue and with a small favicon
HomeServer-side Tracking
Start for free
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 DeduplicationMeta CAPI Gateway
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 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.
  2. Click Tag Configuration and select Google Analytics: GA4.
  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.
  3. Choose Custom as the trigger type.
  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. Use the Preview mode in your GTM server container to simulate incoming events.
  2. In your browser, trigger events on your website (e.g., page views, purchases).
  3. 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).
  4. 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

Where to find your Google Tag

Google Analytics 4 server-side tracking - The full manual
Find expert support
Previous
Create GA4 Event Tags
Next
E-commerce events in GTM
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