Skip to content
Black Week is on: campaign prices on SEO, GEO and content reports, Nov 26 – Dec 2.See the packages →

Google Tag Manager setup (web + server-side)

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.

Get a proposal

Last updated

View as Markdown

Photo: Andrés Felipe Bedoya Interiano · Unsplash

In short

What is Google Tag Manager setup? The answer in one paragraph.

Roicool builds the web container from a measurement plan, wires up tags and triggers, implements Consent Mode v2 and tests every change in Preview mode. Where needed, we set up server-side GTM on Cloud Run with a first-party domain and feed Meta CAPI and enhanced conversions from it.

Last updated: 18 November 2026View as Markdown

Highlights

Figures are sourced; the numbers point to the guide’s source list.

  • A web container runs in the browser; a server container runs on a server you control.

  • With Consent Mode v2, the default consent state must be set before any tag sends data.

  • Google recommends serving the server container from your own first-party domain.

  • Every change is tested in Preview mode and published as a version you can roll back.

Your site has no Google Tag Manager, and tags are hard-coded one by one.

Four problems we solve.

  • 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.

Scope

What we do

01Measurement plan
01

Measurement plan

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

02Web container
02

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, Google).

03Tags, triggers and variables
03

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.

04Consent Mode v2
04

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). For the consent setup itself: Consent Mode.

05Testing and publishing
05

Testing and publishing

Every change is tested in Preview mode with Tag Assistant and published as a named version you can roll back (Google, Google).

06Server-side GTM
06

Server-side GTM

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

Price: by scope, written in the proposalAsk for a proposal

One conversion, from the site to the report.

In server-side tracking the event starts on the site; Google Tag Manager adds the consent state, server-side GTM removes the duplicate and forwards it to GA4, Google Ads and the Meta Conversions API, and the result lands in the Looker Studio report. Tools we use for this: Data Studio, Google Ads, Meta CAPI, Clarity, Semrush, Zoho CRM, Photoshop.

  1. form_submit
  2. consent: granted
  3. duplicate: removed
  4. sent server-side
  5. in the report
  1. Site

    Example event

    • event: form_submit
    • page: /get-a-proposal
    • value: 1200 TRY
  2. GTM

    Example event

    • consent.ad_storage: granted
    • consent.analytics: granted
    • event_id: 7f3a…c21
  3. Server (sGTM)

    Example event

    • event_id: 7f3a…c21
    • dedup: browser + server → 1
    • transport: server
  4. GA4

    Example event

    • GA4 → generate_lead
    • Google Ads → lead (gclid ✓)
    • Meta CAPI → Lead (event_id ✓)
  5. Google Ads

  6. Meta CAPI

  7. Looker Studio

Cases

Results, with their method. Three cases from this service.

All case studies
  • Royal Hair case cover: one budget, two different jobs
    • Royal Hair
    • Medical tourism

    Royal Hair: how did we split a $60,000 budget between two different jobs?

    At Royal Hair, Google Ads captures demand that already exists while a multi-stage Meta funnel carries cold audiences toward a booking. A $60,000 monthly budget is balanced between those two jobs, and CAPI keeps conversion data clean at every stage. The published results: 14x average ROI, an 8% conversion rate and an $11 lead cost, which can vary seasonally.

    Read the Royal Hair case

    Published on the project record: the average of the work so far; can vary seasonally · 2 months (ongoing)

    Sector
    Medical tourism
  • EsteMoon Clinic case cover: campaign split, the Google Ads and Meta logos
    • EsteMoon Clinic
    • Medical tourism

    How did we split campaigns in a clinic with a broad service range?

    Read the EsteMoon Clinic case

    Published average from the clinic's public project record · 2 months (ongoing)

    Albania Hair Clinic case cover: Tirana, location advantage and Meta Ads, the Albania Hair Clinic logo
    • Albania Hair Clinic
    • Medical tourism

    How did we turn a Tirana clinic's location into a Meta Ads strategy?

    Read the Albania Hair Clinic case

    Average in the result set published on the clinic's project page; $30,000 monthly budget, Meta-led structure · 5 months (completed)

Team and proof

The team that does the work, the result we measured. Our rating and our badges can be checked.

Clutch reviewsClutch
4.9★★★★★9 verified reviews

“Roicool maximized our SEO by expanding our site tree with new destination and case study pages, keyword-targeted URLs and a multilingual blog infrastructure, ultimately boosting our brand's AI visibility score to 28+.”

Eda Özden, MEP DMC Managing Director of MEP ·
Clutch profile
Team

Strategy, content, development and measurement in one team.

projects
13
cases
9
Mahmud FiloğluManaging Partner · Owner of this service

Guide. What to know about Google Tag Manager setup (web + server-side).

· Managing Partner · Updated 18 November 2026 · 3 min read

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).

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).

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). For the term itself: 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).

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). For a broader project that includes cross-platform validation and monitoring, see our server-side tracking service.

Rest of the guide3 sections · 1 min read

Web GTM vs server-side GTM

TopicWeb GTMServer-side GTM
Where it runsIn the visitor's browserOn a server you control (such as Cloud Run)
Data flowTags send data from the browser straight to each platformThe browser sends data to your server, and tags forward it from there
CookiesSet with JavaScript in the browserCan be set by the server on a first-party domain
Data controlEach platform's tag decides what it collectsYou decide which fields reach each platform
InfrastructureNo extra serverCloud hosting and maintenance

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

How we work

  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.

What we deliver

  • 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; if the GA4 property itself isn't working correctly, start with GA4 consulting.

New to GTM? Start with What is Google Tag Manager?

Ask AI

Share

Frequently asked questions

  1. 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 ).

    Copy link
  2. 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 ).

    Copy link
  3. 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.

    Copy link
  4. 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.

    Copy link
  5. 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.

    Copy link

Question not here? Write to us

Clutch4.99 reviews (4.9 out of 5) (opens in a new tab)

Let’s start

Let’s find where to start, together.

In a 30-minute intro call we listen to your goals and agree on the right first step.

Ask Ezgi