The Normal Way (Client-Side)
Normally the visitor's browser sends data directly to Google, Facebook and others. Many tags run in the browser. Too many tags slow the page, and ad blockers can stop them.
The Server-Side Way
With server-side tagging, the browser sends one stream of data to your own server container (for example data.example.com). The server then forwards the data to GA4 and other vendors.
Benefits
- Faster pages: fewer scripts in the browser
- More control: you decide what each vendor receives, so you can remove personal data
- First-party context: your own subdomain can make cookies more stable
- Better data quality in some cases, such as with browser tracking limits
Limits and Costs
- The server container needs hosting. Google Cloud (Cloud Run or App Engine) is common, and it costs money that grows with traffic
- It is more complex to build and maintain
- It does not let you skip consent rules. You must still respect visitor choices
- It is not needed for small sites
Setup Overview
- Create a server container in Google Tag Manager
- Let GTM provision a Cloud project automatically (testing) or set up your own cloud hosting (production)
- Map a custom domain such as
data.example.com - In the web container, set the Google tag's server container URL (
server_container_url) - In the server container create a GA4 client and a GA4 tag
- Use Preview in both containers to test
- Publish both
When to Choose It
| Situation | Server-side? |
|---|---|
| Small blog with a few tags | No, keep it simple |
| Ecommerce with many ad platforms and large traffic | Yes, worth considering |
| Strict privacy needs and many vendors | Yes, for control |
| No technical team | Start with web GTM first |
Practice
- Draw the data flow for server-side tagging
- List two benefits and two drawbacks
- Decide if a 5 page company site needs it
Conclusion
Server-side tagging sends data through your own server first. It gives control and speed but adds cost and complexity, so use it when the size of the business justifies it.

