> Site index: https://usehardal.com/llms.txt
> Every content route also serves markdown at <url>.md

# Self-Hosting Server-Side GTM vs Managed Hosting: Costs, Setup and Trade-offs

Self-hosting server-side GTM is quick to start, but domains, scaling, updates and monitoring stay with you. Here is when managed hosting makes more sense.

Source: https://usehardal.com/blog/self-hosting-server-side-gtm-vs-managed-hosting
Published: 2026-12-02
Updated: 2026-12-02
Author: Ecem Bircan
Category: Server-Side Tracking

---

Hi everyone,

Every few weeks someone asks me some version of the same question: "Google gives the [server-side GTM](https://usehardal.com/glossary/server-side-gtm) container away for free, so why would I pay anyone to host it?" Fair question. And honestly, the first time I spun up a tagging server on Cloud Run, I asked it too. The container was live in about twenty minutes and I felt very smart.

Then the real work started, custom domain, preview server, scaling limits, version updates, figuring out why conversions dipped on a Sunday night. That's what this post is about: not "can you self-host sGTM" (yes, you can), but what you're actually signing up for when you do, and when handing it off makes more sense.

## What does self-hosting sGTM on GCP really involve?

Google's official path is pretty clear. You create a server container in GTM, grab the container config string, and deploy the tagging server image to [Cloud Run](https://developers.google.com/tag-platform/tag-manager/server-side/cloud-run-setup-guide) (the older [App Engine setup](https://developers.google.com/tag-platform/tag-manager/server-side/app-engine-setup-guide) still exists, but Cloud Run is where Google points you now). If you'd rather run it on your own Kubernetes cluster or another cloud, there's a [manual setup guide](https://developers.google.com/tag-platform/tag-manager/server-side/manual-setup-guide) for the same Docker image.

So far so good. But a production setup is more than "the container responds." Here's the list I actually go through:

- **Two services, not one.** You need a tagging server *and* a separate preview server, otherwise GTM's preview/debug mode doesn't work. Same image, different environment variables.
- **A first-party domain.** The default `*.run.app` URL works, but it's not your domain, so you lose the main reason you moved server-side. Google's [custom domain guide](https://developers.google.com/tag-platform/tag-manager/server-side/custom-domain) gives you two options, a subdomain like `metrics.example.com` (DNS changes only) or same-origin like `example.com/metrics` (needs a load balancer or CDN in front). Both mean certificates, DNS, and someone who remembers how it was set up.
- **Scaling settings.** Google recommends a minimum of 2 instances in its Cloud Run guide to reduce the risk of data loss if one goes down, plus a max-instances ceiling you have to pick yourself. Too low and you drop requests during a campaign spike. Too high and you've just written yourself a blank check.
- **Region choice.** Where your tagging server runs is where your requests get processed. If you're dealing with GDPR or KVKK, that's not a detail, that's a compliance decision.

None of this is hard on its own. The problem is that it's never "done."

## Why is the ongoing part the expensive part?

This is the bit nobody puts on the slide. Once the container is live, you own it, all of it, forever.

- **Updates.** Google ships new versions of the tagging server image, and their own setup docs tell you to keep it updated after provisioning. On Cloud Run that means redeploying, on your own cluster it means testing and rolling out. If nobody owns this, your container quietly ages.
- **Monitoring.** A tagging server that goes down doesn't throw an error on your website. It just silently drops every conversion behind it. Yeah. You find out when someone asks why Meta reported zero purchases yesterday. So you need alerting on error rates, latency, and instance health, which is its own little project.
- **Cost visibility.** Cloud Run bills you for instances, requests, and outbound traffic. A minimum of 2 always-on instances plus a load balancer for same-origin plus logging adds up, and the bill moves with your traffic, not with your budget.
- **Everything around sGTM.** Most teams don't stop at GA4. They want Meta Conversions API, TikTok Events API, PII hashing before data leaves the server, maybe a BigQuery sink. Each of those is another template to configure, test, and keep alive.

In my experience, the infrastructure bill is rarely what hurts. The engineering hours are. Hardal's own [comparison page](https://usehardal.com/compare/cloud) puts in-house maintenance at roughly 10-20 hours a month of DevOps time, and they're upfront that those numbers are indicative and depend on your team and scope. That matches what I've seen: some months it's nothing, then one month it's an entire week.

## What does managed hosting actually solve?

A managed sGTM provider runs the same Google container, it's not a different product. What changes is who owns the layer around it:

- Domain and certificate setup becomes a dashboard step instead of a DNS-plus-load-balancer project.
- Scaling is handled for you, so a Black Friday spike isn't your on-call engineer's problem.
- Container updates, monitoring, and incident response are on the provider.
- You still own the GTM server container itself, your tags, triggers, and transformations stay yours.

The trade-off is that your requests now pass through someone else's infrastructure. So the questions shift from "how do I run this?" to "where is my data processed, under which agreement, and can I keep it in-region?" Those are the questions I'd ask any provider before signing, including us.

## So who should pick which?

Here's my honest take, side by side:

| | Self-hosted on GCP | Managed hosting |
| --- | --- | --- |
| Software | Google's sGTM container | Google's sGTM container |
| Initial setup | Cloud Run + preview server + domain + scaling config | Mostly configuration in a dashboard |
| Custom domain / first-party | DNS, certificates, load balancer for same-origin | Handled by the provider |
| Scaling | You set min/max instances and watch them | Automatic |
| Updates | You redeploy new image versions | Provider handles it |
| Monitoring & outages | Your alerting, your on-call | Provider's responsibility |
| Data location | Any region your cloud offers, you own the setup | Provider's regions, check they match your needs |
| Real cost | Cloud bill + engineering time | Subscription |

**Self-hosting makes sense if** you already have a platform or DevOps team running containers 24/7, you need a fully custom architecture that goes beyond standard server-side tracking, or internal rules say no external processors, period. If that's you, go for it, and budget for observability before you migrate, not after.

**Managed makes sense if** you're a marketing or analytics team that wants first-party data without becoming an infrastructure team, an agency juggling multiple clients and domains, or basically anyone whose "DevOps team" is one developer who's already busy.

## Where does Hardal fit in?

Full disclosure: I work on Product at Hardal, so read this section with that in mind.

The way we think about it is simple: both paths give you first-party data ownership. The difference is speed, cost, and who carries the maintenance burden. Hardal runs sGTM, Meta Conversions API, and TikTok Events API as a managed service, with automatic scaling, updates, and monitoring included.

A few things I'd actually point out, because they map directly to the self-hosting pain points above:

- **Regions.** Managed hosting runs in the US, UK, EU, EMEA, and Asia, including Türkiye, so data can stay in-region for KVKK and similar requirements. With an in-house build you can use whatever regions your cloud offers, but the residency and compliance work is yours.
- **Privacy built in.** Automatic PII hashing, data redaction, and IP anonymization are part of the platform instead of something you custom-build per tag.
- **Time to live.** Our comparison page estimates 1-3 days for setup versus 4-6 months for a full in-house sGTM + CAPI + Events API build (again, indicative, your scope changes the numbers).
- **You don't have to leave your cloud.** If your warehouse lives on GCP, AWS, or Azure, Hardal can send events to BigQuery or to custom endpoints you run there. You keep your cloud for everything around tracking, we just take the tagging infrastructure off your plate.

And to be fair to the other side: if you have a dedicated DevOps and data engineering team and a genuinely custom architecture in mind, an in-house build can still be the right call. Our own comparison page says that too.

## Quick takeaway

Self-hosting sGTM isn't hard to *start*. It's hard to *keep running well*, updates, scaling, monitoring, domains, and privacy controls are a permanent job, not a launch task. Before you pick a side, write down who on your team owns each of those items a year from now. If every line has a name, self-host. If half the lines say "uh, probably me?", managed hosting is going to save you a lot of Sunday nights.

Curious how you're running it today, self-hosted on Cloud Run, your own cluster, or managed? And what was the thing that surprised you most after go-live?
