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?

  1. User enters the website
  2. Browser downloads GTM container (gtm.js)
  3. GTM loads all configured tags
  4. Each tag sends data directly to its destination server (Google Analytics, Facebook, etc.)
  5. 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?

  1. User enters the website
  2. Browser sends one request to the GTM server (your subdomain)
  3. GTM server receives and processes the data
  4. Server sends data to all configured platforms (GA4, Facebook, etc.)
  5. 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:

  1. Core Web Vitals are a priority - If you’re fighting for every Lighthouse point
  2. Losing data to blockers - When you see discrepancy between GA and other sources
  3. Processing sensitive data - E-commerce, finance, health
  4. GDPR/compliance requirements - You need full control over data
  5. Have budget and resources - Can invest in infrastructure

When to Stay with Client-Side?

Client-side tagging is sufficient when:

  1. You have a simple site - Blog, business card website
  2. Limited budget - Can’t invest in additional infrastructure
  3. No technical resources - Don’t have access to a specialist
  4. 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

  1. Create a Server container in GTM
  2. Configure Cloud Run or other hosting
  3. Set up subdomain (e.g., gtm.yourdomain.com)
  4. Configure SSL

Step 3: Tag Migration

  1. Start with GA4 – simplest migration
  2. Add Google Ads Conversion Tracking
  3. Configure Facebook Conversions API
  4. Test each tag separately

Step 4: Testing and Optimization

  1. Compare data before and after migration
  2. Monitor Core Web Vitals
  3. Check Consent Mode compliance
  4. 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

  1. Google Tag Manager - Server-side tagging https://developers.google.com/tag-platform/tag-manager/server-side

  2. Google Cloud - Deploy server-side GTM https://developers.google.com/tag-platform/tag-manager/server-side/cloud-run-setup-guide

  3. web.dev - Third-party JavaScript performance https://web.dev/articles/third-party-javascript

  4. Apple WebKit - Intelligent Tracking Prevention (ITP) https://webkit.org/blog/category/privacy/

  5. Google Tag Manager Help - Server-side tagging fundamentals https://support.google.com/tagmanager/answer/9205783