WooCommerce plugin has been released on WordPress.orgView plugin →

Self-Host Server-Side GTM on a VPS vs Managed Hosting

What it takes to run Google's server-side GTM image on a VPS: the two servers, HTTPS, updates, numbers from our own load test, and when managed hosting is cheaper.

MHMahmudul HasanNov 15, 20266 min read
The short answer

You can run server-side GTM on any VPS: Google publishes the same Docker image it uses on Cloud Run (gcr.io/cloud-tagging-10302018/gtm-cloud-image:stable). You run it twice, once as the tagging server and once as the single preview server, put both behind HTTPS on your own subdomains, and keep the image updated. The server itself is light: in our load test one container used about 150 MB of memory and handled over 1,000 requests a second on one CPU. What self-hosting really costs is the work around it: certificates, updates, restarts, monitoring and logs. Choose it if you already run servers; choose managed hosting if you want tracking without that job.

TagLinc is managed server-side GTM hosting, so we are not neutral. But we run Google's image ourselves, in Docker on our own servers, so the numbers below are from our own setup, not from a vendor's marketing page.

What "self-hosting" means

Server-side GTM is not something you install from Google Tag Manager's website; it is a program you run. Google ships it as one Docker image with two roles:

RoleWhat it doesHow manySettings it needs
Tagging serverReceives your site's requests and runs the clients and tagsOne or more (Google recommends a cluster for availability)CONTAINER_CONFIG, PREVIEW_SERVER_URL
Preview serverPowers Tag Manager's Preview modeExactly one (Google: do not autoscale it)CONTAINER_CONFIG, RUN_AS_PREVIEW_SERVER=true

CONTAINER_CONFIG is the string Tag Manager shows when you create the server container (Admin → Container settings). The same value goes on every instance.

A minimal VPS setup

  1. Two subdomains pointed at the VPS, for example data.yourstore.com (tagging) and preview.yourstore.com (preview). Using your own domain is what makes server-set cookies work.
  2. Run the preview server: the image with RUN_AS_PREVIEW_SERVER=true and your CONTAINER_CONFIG.
  3. Run the tagging server: the same image with your CONTAINER_CONFIG and PREVIEW_SERVER_URL=https://preview.yourstore.com.
  4. Put a reverse proxy in front (Caddy, Traefik or nginx) for HTTPS certificates. Google's requirement: the proxy's timeout must be longer than 20 seconds, or Preview mode breaks.
  5. Health check: the image answers on /healthy; restart a container that does not.
  6. Tell Tag Manager the tagging server URL (Admin → Container settings → Server container URLs), then point your web container's Google tag at it with server_container_url.

Each server should get at most one CPU: Google says extra CPUs are not used, because the program runs on one core. To handle more traffic you add instances, not cores.

What our own load test showed

On 12 November 2026 we load-tested one of our own Server GTM containers: Google's image, limited to 1 CPU and 2 GB, on a 2 vCPU / 4 GB server, receiving GA4 /g/collect requests over HTTPS.

MeasurementResult
Steady 30-second run, 50 at a timeabout 1,160 requests a second, 0 failed
Response time in that run37 ms median, 108 ms at the 99th percentile
CPUthe container sat at its 1-CPU limit
Memory, tagging serverabout 60 MB idle, about 150 MB under load
Memory, preview serverabout 25 MB

Read this carefully: the test container had no published tags, so nothing was forwarded to Google or Meta. Real tags make each request heavier, which is why Google's own guidance is far lower: it expects 2 to 10 servers to handle 35 to 350 requests a second, depending on your tags. Either way, a typical store sending 1 to 5 million requests a month averages under 2 requests a second. Raw capacity is rarely the problem.

Where the real cost is

Google's own example on Cloud Run costs about $45 a month per server (1 vCPU, 0.5 GB, CPU always allocated), and it recommends at least two servers, so roughly $90 a month before traffic. A small VPS can run the same image for less. The bigger cost on both is the work:

  • Certificates and domains for two subdomains, renewed automatically and monitored.
  • Image updates. Google updates the image for security fixes and new features and recommends updating at least on each major version, and restarting periodically. Every instance and the preview server need the same version.
  • Uptime. One server is a single point of failure: when it is down, events are lost, not queued. Google recommends a cluster for this reason.
  • Monitoring and logs. Without request logs you cannot tell whether a drop in conversions is your ads or your server.
  • Scaling for peaks such as sale days, and your own time when something breaks on a weekend.

Self-hosting vs Cloud Run vs managed hosting

Your own VPSGoogle Cloud RunManaged host (e.g. TagLinc)
Monthly costThe VPS, plus your timeAbout $45 per server, 2 recommended, plus trafficA flat plan (TagLinc: free up to 15,000 requests, then $15 to $75)
SetupDocker, proxy, certificates, two subdomainsGoogle's setup flow, then domain mappingCreate a container, add a domain
Updates and restartsYouYou (redeploy)The host
Request logsYou build themCloud Logging, billed by volumeIncluded
ControlFullHighLower: the host decides the setup

For Cloud Run in more detail, see TagLinc vs Google Cloud. To compare prices at your own volume, use the Server GTM cost calculator.

When self-hosting makes sense

  • You already run servers with monitoring, and one more Docker service is little extra work.
  • You need full control: a specific country for data, your own logging pipeline, custom networking.
  • You run many containers for clients (an agency) and want one setup for all of them.

When managed hosting is the better deal

  • Nobody on the team wants to be on call for tracking.
  • One store, a few million requests a month: the plan costs less than an hour of an engineer's time.
  • You want request logs, a custom loader path and cookie extension without building them.

If you self-host: a checklist

  • Tagging server on your own subdomain, HTTPS, proxy timeout over 20 seconds.
  • Exactly one preview server, on its own HTTPS URL, set as PREVIEW_SERVER_URL.
  • At most 1 CPU per instance; at least two tagging instances if a lost hour of data matters.
  • Health check on /healthy with automatic restart.
  • A routine for image updates and restarts, applied to every instance.
  • Request logging and an alert when requests drop to zero.
  • 0 of 6 done
Not sure your tracking is right?

We check your setup for free and send you what to fix.

Free tracking audit

FAQ

The software is free; the server, the domains and your time are not. Google does not charge for the image itself.

Less than most people think: in our test one container used about 150 MB of memory under load and one CPU. Plan by availability (two instances) rather than raw power.

No. You need to run Docker containers (or Node.js processes) and a reverse proxy, which shared web hosting does not allow.

Some control over the setup. You keep your own GTM containers, tags and data: moving between hosts is a matter of pointing your subdomain elsewhere.

Sources

MH
Founder of TagLinc. Mahmudul builds the TagLinc platform, writes its documentation and answers the support email himself.