Google Tag Manager (GTM) is one of the most popular tools for managing tags on websites. Traditionally, it operated in a client-side model, running in the user’s browser. However, since 2020, Google has introduced an alternative – server-side tagging. Which model should you choose and when is it worth switching to a server solution?
What is Client-Side Tagging?
Client-side tagging is the traditional model where all tags (Google Analytics, Facebook Pixel, ads) are loaded directly in the user’s browser. When a visitor enters the site, the browser downloads the GTM container and then executes all configured tags.
How Does Client-Side GTM Work?
- User enters the website
- Browser downloads GTM container (gtm.js)
- GTM loads all configured tags
- Each tag sends data directly to its destination server (Google Analytics, Facebook, etc.)
- Browser executes all JavaScript scripts
This model is simple to implement and requires no additional infrastructure. However, it has significant limitations that are becoming increasingly problematic.
What is Server-Side Tagging?
Server-side tagging moves tag processing from the browser to a dedicated server. Instead of multiple scripts loaded in the browser, data is sent to a single endpoint, and then the GTM server distributes it to the appropriate platforms.
How Does Server-Side GTM Work?
- User enters the website
- Browser sends one request to the GTM server (your subdomain)
- GTM server receives and processes the data
- Server sends data to all configured platforms (GA4, Facebook, etc.)
- Browser doesn’t need to load multiple external scripts
Comparison: Server-Side vs Client-Side
Performance and Core Web Vitals
Client-side:
- Multiple external JavaScript scripts
- Each tag increases page load time
- Negative impact on Core Web Vitals, especially LCP and TBT
- Blocking the browser’s main thread
Server-side:
- Minimal JavaScript code in browser
- One network request instead of many
- Significant Core Web Vitals improvement
- Better page responsiveness
In practice, switching to server-side tagging can improve Lighthouse scores by 10-30 points in the Performance category.
Privacy and GDPR Compliance
Client-side:
- Third-party scripts have access to user’s browser
- Cookies set by external domains (third-party cookies)
- Limited control over transmitted data
- More difficult consent management
Server-side:
- Full control over data before sending to platforms
- Ability to filter and anonymize data
- Cookies set as first-party (from your domain)
- Easier Consent Mode implementation
Resistance to Ad Blockers and ITP
Client-side:
- Ad blockers block known tracking domains
- Safari ITP limits cookie lifetime to 7 days (or 24h)
- Loss of significant analytics data (10-30%)
- External domains are easy to identify
Server-side:
- Data sent to your own subdomain
- First-party cookies not subject to ITP restrictions
- Much harder to block
- Recovery of lost analytics data
Data Control and Security
Client-side:
- Data sent directly from browser
- No ability to modify before sending
- Risk of sensitive data leakage (PII)
- External scripts can be attack vectors
Server-side:
- Central control over all data
- Ability to remove PII before sending to platforms
- Logging and auditing of transmitted data
- Smaller attack surface
Disadvantages of Server-Side Tagging
Despite numerous advantages, server-side tagging also has significant disadvantages:
Infrastructure Costs
Server-side GTM requires a dedicated server. Google Cloud Run is the most popular option:
- Small sites (up to 100k pageviews/month): ~$20-50/month
- Medium sites (100k-1M pageviews): ~$50-200/month
- Large sites (1M+ pageviews): $200-1000+/month
Alternatively, you can use AWS, Azure, or your own server, but this requires more configuration.
Implementation Complexity
- Requires server and DNS configuration
- More complicated debugging
- Need to maintain infrastructure
- Technical knowledge or specialist required
Limitations of Some Tags
Not all tags work correctly in server-side mode:
- Remarketing requires additional configuration
- Some third-party tags don’t have server-side equivalents
- Heatmaps and session recording often require client-side
When to Choose Server-Side Tagging?
Server-side tagging is especially recommended when:
- Core Web Vitals are a priority - If you’re fighting for every Lighthouse point
- Losing data to blockers - When you see discrepancy between GA and other sources
- Processing sensitive data - E-commerce, finance, health
- GDPR/compliance requirements - You need full control over data
- Have budget and resources - Can invest in infrastructure
When to Stay with Client-Side?
Client-side tagging is sufficient when:
- You have a simple site - Blog, business card website
- Limited budget - Can’t invest in additional infrastructure
- No technical resources - Don’t have access to a specialist
- Using many third-party tags - That don’t have server-side versions
Hybrid Solution
In practice, a hybrid approach is most commonly used:
- Server-side for key tags: GA4, Google Ads, Facebook CAPI
- Client-side for tags requiring browser access: heatmaps, chatbots
This approach provides the best balance between performance, data control, and functionality.
How to Start Migration?
Step 1: Audit Current Tags
Identify all tags in your current GTM container:
- Which are critical for business?
- Which have server-side equivalents?
- Which must remain client-side?
Step 2: Server Configuration
- Create a Server container in GTM
- Configure Cloud Run or other hosting
- Set up subdomain (e.g.,
gtm.yourdomain.com) - Configure SSL
Step 3: Tag Migration
- Start with GA4 – simplest migration
- Add Google Ads Conversion Tracking
- Configure Facebook Conversions API
- Test each tag separately
Step 4: Testing and Optimization
- Compare data before and after migration
- Monitor Core Web Vitals
- Check Consent Mode compliance
- Optimize server costs
Summary
Server-side tagging is the future of tag management. It offers better performance, greater data control, and resistance to browser restrictions. However, it requires investment in infrastructure and technical knowledge.
Client-side tagging remains a simpler solution for smaller sites and limited budgets, but its limitations will become increasingly noticeable as browser privacy policies tighten.
For most medium and large sites, the best solution is a hybrid approach – moving critical tags to the server while maintaining some client-side functions. This allows you to reap the benefits of both worlds without compromising functionality.
Sources
-
Google Tag Manager - Server-side tagging https://developers.google.com/tag-platform/tag-manager/server-side
-
Google Cloud - Deploy server-side GTM https://developers.google.com/tag-platform/tag-manager/server-side/cloud-run-setup-guide
-
web.dev - Third-party JavaScript performance https://web.dev/articles/third-party-javascript
-
Apple WebKit - Intelligent Tracking Prevention (ITP) https://webkit.org/blog/category/privacy/
-
Google Tag Manager Help - Server-side tagging fundamentals https://support.google.com/tagmanager/answer/9205783



