---
type: "Service"
title: "Google Tag Manager setup (web + server-side)"
description: "We build your web container from a measurement plan and, where it fits, add server-side GTM so data reaches each platform through your own server."
url: "https://www.roicool.com/en/services/google-tag-manager-setup"
lang: "en"
dateModified: "2026-11-18"
expert: "Mahmud Filoğlu"
resource: "https://www.roicool.com/en/services/google-tag-manager-setup"
alternates:
  tr: "https://www.roicool.com/hizmetler/google-tag-manager-kurulumu.md"
generated: { by: "process:roicool-cms", at: "2026-11-18T00:00:00.000Z" }
related:
  - { title: "İstanbul Care", resource: "https://www.roicool.com/en/projects/istanbul-care.md" }
  - { title: "Royal Hair", resource: "https://www.roicool.com/en/projects/royal-hair.md" }
  - { title: "EsteMoon Clinic", resource: "https://www.roicool.com/en/projects/estemoon-clinic.md" }
  - { title: "Albania Hair Clinic", resource: "https://www.roicool.com/en/projects/albania-hair-clinic.md" }
  - { title: "Alaka AI", resource: "https://www.roicool.com/en/projects/alaka-ai.md" }
  - { title: "All projects", resource: "https://www.roicool.com/en/case-studies.md" }
  - { title: "Analytics consulting", resource: "https://www.roicool.com/en/services/analytics-consulting.md" }
  - { title: "Server-side tracking", resource: "https://www.roicool.com/en/services/server-side-tracking.md" }
  - { title: "Consent Mode setup and KVKK", resource: "https://www.roicool.com/en/services/consent-mode.md" }
  - { title: "GA4 consulting", resource: "https://www.roicool.com/en/services/ga4-consulting.md" }
  - { title: "Firebase Analytics consulting and mobile measurement", resource: "https://www.roicool.com/en/services/firebase-analytics.md" }
  - { title: "Marketing data warehouse", resource: "https://www.roicool.com/en/services/marketing-data-warehouse.md" }
  - { title: "Looker Studio reporting (Data Studio)", resource: "https://www.roicool.com/en/services/looker-studio-reporting.md" }
---

# Google Tag Manager setup (web + server-side)

Google Tag Manager setup means installing a web container on your site and managing GA4, Google Ads, Meta and other tags from it without editing site code for each tag. It covers tags, triggers and Consent Mode v2; server-side GTM then routes data through your own server (on Cloud Run, for example) before it reaches each platform.

- Your site has no Google Tag Manager, and tags are hard-coded one by one.
- There is a container, but nobody knows what fires in it or why.
- Consent Mode v2 is missing, or the default consent runs after your tags.
- You want to feed Meta Conversions API and Google Ads enhanced conversions from a server.

### Measurement plan

Which conversions and events to track, with their names and parameters, written down before a single tag is built.

### Web container

Account and container structure (one container per website), the container snippet placed as high in the `<head>` as possible, and dataLayer events ([Google](https://support.google.com/tagmanager/answer/14842164), [Google](https://support.google.com/tagmanager/answer/14847097)).

### Tags, triggers and variables

The Google tag and GA4, Google Ads conversion and remarketing tags, Meta Pixel, LinkedIn Insight Tag and other platforms, with consistent naming conventions.

### Consent Mode v2

The default consent state set before any tag fires; ad\_storage, analytics\_storage, ad\_user\_data and ad\_personalization updated from your consent banner; a basic or advanced implementation ([Google](https://developers.google.com/tag-platform/security/guides/consent)). For the consent setup itself: [Consent Mode](https://www.roicool.com/en/services/consent-mode).

### Testing and publishing

Every change is tested in Preview mode with Tag Assistant and published as a named version you can roll back ([Google](https://support.google.com/tagmanager/answer/6107056), [Google](https://support.google.com/tagmanager/answer/6107163)).

### Server-side GTM

A server container on Cloud Run, a first-party domain, Meta CAPI and enhanced conversions: details below.

## Server-side GTM setup on Cloud Run

### Hosting on Cloud Run

The server container can be provisioned automatically from Tag Manager or manually in Google Cloud. It needs a tagging server for live traffic and a preview server for the Preview feature. For production, Google recommends running at least 2 instances to reduce the risk of data loss during an outage, and setting a billing alert to avoid unexpected charges ([Google](https://developers.google.com/tag-platform/tag-manager/server-side/cloud-run-setup-guide)).

### First-party domain

Google says the tagging server and your website must share a domain to get first-party benefits; on the cloud provider's default domain, server-set cookies aren't available. Same-origin serving (such as www.example.com/metrics) is Google's best practice, and a subdomain (metrics.example.com) gives the same cookie benefits with a simpler DNS setup ([Google](https://developers.google.com/tag-platform/tag-manager/server-side/custom-domain)).

### Meta Conversions API

Events from the web container reach the server container through the GA4 client, and Meta's Conversions API tag forwards them to Meta. When the same event is sent from both the browser pixel and the server, both use the same event\_name and the same event\_id (or external\_id and fbp) so Meta can deduplicate them ([Meta](https://developers.facebook.com/docs/marketing-api/conversions-api/guides/gtm-server-side)). For the term itself: [CAPI](https://www.roicool.com/en/glossary/capi).

### Enhanced conversions

Enhanced conversions send first-party data such as email addresses or phone numbers to Google Ads, hashed with SHA256. With server-side GTM, when your scripts load through the server container, the data goes from the browser to it, and the Google Ads tag encrypts it before it reaches Google ([Google](https://support.google.com/google-ads/answer/9888656)).

### Data control

Google notes that only you can access data in the server container until you choose to send it elsewhere, and you decide which fields go to which platform ([Google](https://developers.google.com/tag-platform/tag-manager/server-side/intro)). For a broader project that includes cross-platform validation and monitoring, see our [server-side tracking](https://www.roicool.com/en/services/server-side-tracking) service.

## Web GTM vs server-side GTM

| Topic | Web GTM | Server-side GTM |
| --- | --- | --- |
| Where it runs | In the visitor's browser | On a server you control (such as Cloud Run) |
| Data flow | Tags send data from the browser straight to each platform | The browser sends data to your server, and tags forward it from there |
| Cookies | Set with JavaScript in the browser | Can be set by the server on a first-party domain |
| Data control | Each platform's tag decides what it collects | You decide which fields reach each platform |
| Infrastructure | No extra server | Cloud hosting and maintenance |

Source: Google Tag Manager documentation on server-side tagging and custom domains.

1. **Audit:** current tags, conversion definitions and consent setup.
2. **Measurement plan:** events, parameters and conversions.
3. **Web container build:** tags, triggers and Consent Mode v2.
4. **Testing and publishing:** checks in Preview mode, versioned publishing.
5. **Server-side GTM:** Cloud Run, domain, platform connections and a parallel run with the existing setup.
6. **Validation and handover:** data comparison, documentation and access handover.

- Measurement plan (events, parameters, conversions)
- A web container that follows the naming conventions, published as versions
- Consent Mode v2 settings and test notes
- Where in scope, a server container on Cloud Run with a first-party domain
- Handover document: tag inventory, publishing and rollback steps

**A good fit:** companies running Google Ads or Meta ads that need conversions measured correctly; sites with no GTM or an unmanaged container; teams moving to the server side.

**Another service may fit better:** for a broader server-side measurement project that also covers LinkedIn and other platforms, with data control and monitoring, see [server-side tracking](https://www.roicool.com/en/services/server-side-tracking); if the GA4 property itself isn't working correctly, start with [GA4 consulting](https://www.roicool.com/en/services/ga4-consulting).

New to GTM? Start with [What is Google Tag Manager?](https://www.roicool.com/en/blog/what-is-google-tag-manager)

## Work we did in this area

- [İstanbul Care](https://www.roicool.com/en/projects/istanbul-care)
- [Royal Hair](https://www.roicool.com/en/projects/royal-hair)
- [EsteMoon Clinic](https://www.roicool.com/en/projects/estemoon-clinic)
- [Albania Hair Clinic](https://www.roicool.com/en/projects/albania-hair-clinic)
- [SDF](https://www.roicool.com/en/projects/sdf)
- [Küçükçekmece Hastanesi](https://www.roicool.com/en/projects/kucukcekmece-hastanesi)
- [Lin Clinic](https://www.roicool.com/en/projects/lin-clinic)
- [Alaka AI](https://www.roicool.com/en/projects/alaka-ai)
- [All projects](https://www.roicool.com/en/case-studies)

## More services in Analytics consulting

- [Analytics consulting](https://www.roicool.com/en/services/analytics-consulting)
- [Server-side tracking](https://www.roicool.com/en/services/server-side-tracking)
- [Consent Mode setup and KVKK](https://www.roicool.com/en/services/consent-mode)
- [GA4 consulting](https://www.roicool.com/en/services/ga4-consulting)
- [Firebase Analytics consulting and mobile measurement](https://www.roicool.com/en/services/firebase-analytics)
- [Marketing data warehouse](https://www.roicool.com/en/services/marketing-data-warehouse)
- [Looker Studio reporting (Data Studio)](https://www.roicool.com/en/services/looker-studio-reporting)

## FAQ

### What is the difference between web GTM and server-side GTM?

A web container runs in the visitor's browser, and its tags send data from the browser straight to each platform. With server-side GTM, the browser sends data to a server container on a server you control; there, clients turn each request into an event and tags forward it to GA4, Google Ads or Meta. The server container uses the same tags, triggers and variables model, and Google notes that only you can access the data on the server until you choose to send it elsewhere ( Google ).

### Does server-side GTM have to run on Cloud Run?

No. The server container can run in your own Google Cloud project or in another environment you choose ( Google ). Cloud Run's advantage is that Tag Manager can provision the server automatically. For production, Google recommends running at least 2 instances to reduce the risk of data loss during an outage; cloud costs depend on traffic and the number of instances ( Google ).

### Do we remove the web container when we move to server-side GTM?

No. The web container stays on the site and becomes the part that sends data from the browser to the server container; the Google tag is pointed at the server with the server\_container\_url setting ( Google ). We run the new setup in parallel with the existing one and move traffic to the server once both sides' data has been compared and validated.

### Is Consent Mode v2 part of the setup?

Yes. The default consent state is set before any tag sends measurement data; Google notes that defaults won't work if the consent code runs out of order. Along with ad\_storage and analytics\_storage, the v2 parameters ad\_user\_data and ad\_personalization are updated from your consent banner ( Google ). For choosing a consent management platform and the KVKK side, see our Consent Mode service.

### What happens if a change breaks something after setup?

Tag Manager keeps every publish as a version, so if a faulty change goes live you can roll back to an earlier one, and the publish history shows which version was live when and who published it ( Google ). That's why we test every change in Preview mode first, publish it under a descriptive version name and write the rollback steps into the handover document.

Breadcrumb: [Home](https://www.roicool.com/en) › [Services](https://www.roicool.com/en/services) › [Analytics consulting](https://www.roicool.com/en/services/analytics-consulting) › Google Tag Manager setup (web + server-side)

Source: https://www.roicool.com/en/services/google-tag-manager-setup · Last updated: 2026-11-18
