RGM-GT-02 · GTM Server-Side · Module 2 of 5
RGM° · Training

Server-Side Container Architecture

Server-side container architecture is more powerful than client-side but requires deliberate design. This module covers the hosting, the components, and the architecture decisions that determine cost and capability.

What you will learn

  1. Server-side container architecture in detail
  2. Cloud hosting: Google Cloud Run, AWS, self-hosted
  3. Subdomain setup and first-party data flow
  4. Clients, tags, triggers, variables in the server container
  5. The GA4 client and the Web Container client
  6. Custom clients for non-Google events
  7. Data enrichment in transit
  8. Filtering, transformation, redaction
  9. Logging and monitoring
  10. Cost optimization at scale
  11. Common architecture mistakes

1. Server-side container architecture

A server-side container is a server (or serverless function) running Google Tag Manager's server logic. It receives HTTP requests from clients, processes them through tags, and sends data to destinations.

2. Cloud hosting

3. Subdomain setup

Best practice: route requests through your own subdomain (analytics.yourdomain.com or similar). Benefits:

4. Container objects

5. The GA4 and Web Container clients

The GA4 client receives data from gtag.js / GA4 events. The Web Container client receives data from a client-side tag manager. Most production setups use both.

6. Custom clients

Custom clients enable bespoke event collection. Example: a backend system sends purchase events server-to-server; a custom client receives them and forwards to vendors.

7. Data enrichment

Server-side processing can enrich events with: server-side user IDs, customer data from CDP, normalized product data, hashed PII for vendor matching.

8. Filtering and redaction

9. Logging and monitoring

10. Cost optimization

11. Common mistakes

Hosting the container without a custom subdomain. Sending raw PII to vendors. Not setting up vendor delivery monitoring. Treating sGTM as a fire-and-forget setup; ongoing tuning is required. Letting consent-mode rules apply only client-side.
How to use this module: The hosting options (Section 2), the subdomain principle (Section 3), and the common mistakes (Section 11) are the planning artifacts.

Sources & further reading


Part of the GTM Server-Side series · RGM Training