Finding the best server side tracking setup means choosing between a free container like Google Tag Manager Server-Side or a dedicated pipeline like Segment. You need a solution that fixes attribution, respects privacy laws and fits your current infrastructure. This guide breaks down the top tools and explains how to configure them without over-reporting your data.
Google Tag Manager Server-Side
Google Tag Manager Server-Side is the most common starting point for small businesses looking for the best server side tracking option on a budget. It uses a free container that runs on Google Cloud Run. You configure it to forward hits to GA4, Google Ads, Facebook CAPI and other destinations. To set it up, you need a Cloud Run service, a DNS CNAME record and a basic understanding of JavaScript and JSON.
The main benefit is the cost. You only pay for the Google Cloud Run compute time, which is very low for small traffic volumes. You also gain control over what data leaves your server. You can strip personal identifiable information before sending hits to advertising platforms.
The setup requires a few specific steps:
- Create a new server container in Google Tag Manager. Google provides a command to deploy this container directly to Google Cloud Run.
- Enable billing on your Google Cloud project, even though the costs will likely be a few pence per month for a small site.
- Configure a subdomain, such as
metrics.yourdomain.com. Point this subdomain to your Cloud Run service using a DNS CNAME record. This step is critical because it routes tracking requests through your own domain, bypassing many ad blockers. - Inside the GTM container, use the GA4 client to parse incoming hits. Map parameters like
client_idandsession_idcorrectly. - For Facebook CAPI, use the Conversions API tag. Pass the hashed email address and the
fbpcookie from the browser to the server. - Validate using the GTM preview mode and the browser network tab. If the CNAME is not configured correctly, ad blockers might still intercept the requests.
- Monitor your Cloud Run logs to ensure hits are not dropping.
This setup works well if you want to fix attribution for Meta and Google Ads without building a full data pipeline. You can read more about how we handle this on our work page. Google's official documentation for the server-side container is available at developers.google.com, and it covers the provisioning steps in detail.
Twilio Segment and RudderStack
When you outgrow a tag manager, you need a customer data platform. Twilio Segment and RudderStack are the two main options for routing events to multiple destinations.
Twilio Segment offers a free tier up to 1 million events per month. After that, you pay based on usage. Segment provides a unified API, schema enforcement and a large library of destinations. You can use Segment Cloud or self-host the Java or Node server. The unified API means you call analytics.track from your backend, and Segment handles the rest. The schema enforcement feature prevents bad data from entering your pipeline. If a developer sends an event with the wrong data type, Segment rejects it. This is a robust choice if you want to send the exact same event to your email tool, your database and your ad platforms.
RudderStack is the open-source alternative. It offers a free community edition and paid plans for higher volume. It provides event routing, data transformation and built-in GDPR and CCPA features. You can run it on Docker or Kubernetes, or use their managed cloud. RudderStack gives you a transformer feature. You can write JavaScript to modify events before they reach the destination. For example, you can drop a field if the user did not consent to advertising tracking. RudderStack is the best server side tracking option if you want full control over your data pipeline without vendor lock-in. Segment is easier to set up but costs more at scale. RudderStack requires more DevOps knowledge but is cheaper to run.
Here is a quick comparison of the two platforms:
| Feature | Twilio Segment | RudderStack |
|---|---|---|
| Free tier | 1 million events per month | Community edition, self-hosted |
| Hosting | Cloud or self-host | Docker, Kubernetes or managed cloud |
| Schema enforcement | Built in | Manual via transformers |
| Data transformation | Limited | Full JavaScript transformers |
| GDPR and CCPA tools | Built in | Built in |
| Best for | Teams that want speed and reliability | Teams that want control and lower costs |
Snowplow, Adobe and Matomo
For advanced analytics needs, you might look at Snowplow, Adobe or Matomo.
Snowplow Analytics is an open-source pipeline with a collector, enricher and storage. It supports real-time event modeling and strict GDPR controls. It requires Docker or Kubernetes, a managed cloud environment and a data warehouse like Redshift or BigQuery. The pipeline works like this: the collector receives the hit, the enricher adds IP location and user agent parsing, and the storage module puts the clean data in BigQuery. Snowplow is for companies that want to treat event data as a first-class asset in their own warehouse. Data scientists can query the raw events directly in SQL, build custom models and join the data with CRM or product tables. The trade-off is complexity. You need a data engineering team to maintain the pipeline, handle schema migrations and monitor the enricher for failures.
Adobe Experience Platform offers server-side forwarding through its Edge Network. If you already use Adobe Analytics or Adobe Target, the Edge Network lets you route events to Adobe solutions and third-party destinations from a single server endpoint. The setup requires an Adobe Experience Platform account, a datastream configuration and the Adobe Experience Platform Edge SDK. You configure data elements in the Launch tag manager, map them to XDM schema fields and forward them server-side. Adobe is a strong choice for enterprise teams already invested in the Adobe stack, but the licensing cost makes it impractical for small businesses.
Matomo offers a self-hosted analytics platform with a server-side tracking API. You send hits to your own Matomo instance using the HTTP API, which keeps all data on your infrastructure. The setup requires a PHP server, a MySQL database and the Matomo application itself. You call the track endpoint with parameters like idsite, rec and action_name. Matomo is suitable if your priority is data ownership and you want a free, open-source alternative to GA4. However, it lacks the destination routing and transformation features of Segment or RudderStack. You can learn more about how we compare these tools on our blog.
How to Choose the Right Tool
Your choice depends on three factors: traffic volume, team skills and existing infrastructure.
For small businesses with under 100,000 monthly sessions, Google Tag Manager Server-Side is the best server side tracking starting point. The cost is negligible, the setup is documented thoroughly and you can forward hits to the major ad platforms. You do not need a data engineering team. You need someone who understands GTM, DNS and basic JavaScript.
For mid-market companies with multiple destinations and a development team, Segment or RudderStack makes more sense. Both handle event routing at scale and give you a single API for all your tracking needs. Segment is faster to implement. RudderStack is cheaper at high volume and gives you more control over data transformation. If your developers are comfortable with Docker and Kubernetes, RudderStack is the stronger choice.
For enterprise teams with a data warehouse and data scientists, Snowplow is the most powerful option. It puts clean, enriched event data directly into your warehouse. You own the schema, the pipeline and the storage. The cost is engineering time, not a SaaS subscription. If you already use Adobe, the Edge Network is the natural extension of your existing stack.
For teams that prioritise data ownership above all else, Matomo is a viable option. It is free, open-source and keeps everything on your own servers. The limitation is that it is an analytics platform, not a customer data platform. You cannot route events to multiple destinations the way you can with Segment or RudderStack.
Common Setup Mistakes
Even with the right tool, several mistakes cause data quality problems:
- Forgetting to validate the CNAME configuration. If the subdomain does not resolve correctly, ad blockers will still intercept requests and you will see attribution gaps.
- Sending unhashed email addresses to Facebook CAPI. The Conversions API requires SHA-256 hashed values. If you send plain text, Facebook rejects the events.
- Not mapping
client_idandsession_idbetween the browser and the server. If these values do not match, GA4 will create new sessions for every server-side hit. - Ignoring consent signals. You must pass the consent state from the browser to the server and use it to filter events before they reach advertising destinations.
- Overlooking Cloud Run timeout settings. If your container takes too long to process a hit, Cloud Run kills the request and the event is lost.
You can avoid these issues by testing in GTM preview mode before publishing, checking your destination platforms for matching event counts and monitoring server logs for errors. Our pricing page outlines what we charge for a full audit and implementation.
Next Steps
The best server side tracking setup is the one that matches your traffic, your team and your existing tools. Start with GTM Server-Side if you are small. Move to Segment or RudderStack when you need a real pipeline. Choose Snowplow when your data team needs raw events in the warehouse. If you want help implementing any of these, our server-side tracking service covers the full setup, from DNS configuration to event validation.