Skip to main content

Does Google Analytics show fewer visits than the number of orders your online shop has received? Do Meta and Google Ads report different figures for the same campaign? If so, you’re far from alone. Browsers block cookies, ad blockers stop tracking scripts, and users are refusing to give their consent. The result is gaps in your data and ad platforms optimising on an incomplete basis.

Server-side tracking is the solution that more and more Danish companies are choosing to obtain more reliable data. In this guide, you’ll find out what server-side tracking is, how it works in practice, what server-side tagging and sGTM mean, and what you need to be aware of in relation to the GDPR. Finally, we’ll walk you through how to get started.

What is server-side tracking?

Server-side tracking is a method of collecting and sending data on your visitors’ behaviour, whereby a server under your control is responsible for forwarding the data to your analytics and advertising platforms. With traditional tracking, this happens directly from the visitor’s browser.

When a visitor adds an item to their basket or completes a purchase, the browser currently typically sends a series of separate signals directly to Google Analytics, Meta, Google Ads, TikTok and other platforms. Each signal requires its own script on the page. With server-side tracking, the browser instead sends a single, consolidated signal to your own tracking server. The server processes the data and forwards it to the platforms you use.

You can think of it as a post office. Instead of each platform collecting its own information directly from the visitor, everything is gathered in one place, where you decide what is forwarded and to whom.

If you’d like to see how it works as a comprehensive solution, you can read more about server-side tracking with WeTrack.

How server-side tracking works in practice

To understand how it all fits together, it is helpful to be familiar with the three stages through which data passes.

From your browser to your own server

When a visitor interacts with your website, the event is still recorded in the browser – for example, a page view, a click or a purchase. The difference lies in where the data is sent. Instead of going directly to third parties, the event is sent to a server on a subdomain that belongs to you, e.g. data.dinwebshop.dk. Because the server is located on your own domain, the connection is treated as first-party.

The server forwards data to your platforms

The event is received by the server and converted into the format expected by each platform. The data is then forwarded via the platforms’ own interfaces, such as the Meta Conversion API, Google Analytics 4 and Google Ads. This takes place server-to-server, so the browser does not need to load a script for each individual platform.

Server-side tagging and sGTM

Server-side tagging is the technical term for moving your tags – that is, the small pieces of code that send data to platforms – from the browser to a server. The most widely used solution is sGTM, which stands for server-side Google Tag Manager.

sGTM functions like a standard Google Tag Manager container, but it runs on a server rather than in the browser. The container consists of clients that receive data and tags that forward data. The container must be hosted somewhere, typically on Google Cloud or with a specialist hosting provider. Many people opt for a managed solution, where hosting, setup and operation are handled on their behalf. You can read more about GTM server-side tracking and how the setup is typically carried out.

Server-side tracking explained with an example

Imagine an online shop that sells running shoes and advertises on both Google Ads and Meta.

A customer finds the online shop via an advert on Instagram, looks at a pair of shoes and returns four days later to buy them. The customer is using an iPhone with Safari and has an ad blocker installed.

With traditional client-side tracking, there is a high risk that the Meta pixel will be blocked by an ad blocker, and that the cookie from the first visit will have been deleted or will have expired by the time the customer returns. As a result, the purchase is either not recorded, or it is not linked to the advert that generated it. Meta assumes that the advert did not work and optimises away from it.

With server-side tracking, the purchase is sent to the online shop’s own tracking server on a first-party subdomain. The server forwards the purchase to Meta via the Conversion API, and to Google Analytics and Google Ads. The purchase is recorded more reliably, and the advertising platforms gain a more accurate picture of what drives sales.

Why has server-side tracking become necessary?

Tracking directly in the browser has been working for many years, but conditions have changed significantly in recent years.

Browsers restrict cookies

Safari limits the lifetime of cookies set via JavaScript in the browser to typically seven days, and in some cases even less. Firefox and Brave offer similar protection. This means that a visitor returning after a week often appears as a completely new visitor. Cookies set correctly from a first-party server can have a longer lifespan and thus provide a more coherent picture of the customer journey.

Ad blockers and privacy extensions

A significant proportion of internet users have an ad blocker or a privacy extension installed. These often block well-known tracking scripts such as the Meta pixel and Google Analytics. When data is sent to your own domain rather than directly to third parties, fewer events are blocked.

Advertising platforms need stronger signals

Google Ads, Meta and TikTok use conversion data to optimise your campaigns automatically. The fewer conversions the platforms see, the less effective their optimisation becomes, and the more expensive each customer becomes. That is why the platforms themselves recommend supplementing browser tracking with server-side solutions such as the Meta Conversion API and Enhanced Conversions for Google Ads.

Advantages of server-side tracking

Server-side tracking offers a number of benefits that affect your data, your website and your advertising.

More comprehensive data

When fewer events are blocked and cookies last longer, you’ll get more comprehensive data in your reports. This provides a more accurate picture of which channels and campaigns are actually generating sales.

Better performance on your website

Every tracking script that the browser has to load makes the page a little slower to load. With server-side tracking, many scripts can be replaced by a single consolidated data stream, so the page loads faster. This provides a better user experience and can have a positive impact on both your conversion rate and your Google rankings.

Control over personal data

When data passes through your own server, you decide what is passed on. For example, you can remove IP addresses, anonymise information or choose not to send certain fields to specific platforms. This gives you far greater control than when third-party scripts collect data directly in the browser.

Better results from advertising

When Google Ads and Meta receive more and more accurate conversions, their algorithms can target your adverts more effectively. This can lead to a lower cost per conversion and a more accurate picture of your return on ad spend.

Disadvantages and limitations of server-side tracking

Server-side tracking isn’t a solution you can simply switch on. There are also a few things you need to be aware of before you get started.

The setup requires technical knowledge

Server-side tracking requires a server container, a subdomain with the correct DNS settings, the configuration of clients and tags, and thorough testing. Errors in the configuration can lead to duplicate conversions or missing data. That is why many people choose to have the setup carried out by specialists.

Hosting and operation costs

A tracking server needs to be hosted and maintained. The cost depends on your traffic and on whether you host it yourself or use a managed solution. On top of this, you’ll need to spend time keeping the setup up to date as platforms change their requirements.

Consent remains valid

Server-side tracking is not a way of circumventing consent. If a visitor opts out of analytics or marketing cookies, you must not track them for those purposes, regardless of whether the data is sent via the browser or the server. A correct setup always respects the user’s choice.

Server-side tracking and the GDPR

The GDPR and the Danish cookie regulations apply in full, even when you use server-side tracking. You must still obtain valid consent before collecting data for statistical and marketing purposes, and you must be able to document how the data is processed.

On the other hand, server-side tracking gives you better options for complying with the regulations in practice. You can control exactly what information leaves your server, and you can ensure that the consent signal from your cookie banner accompanies the data all the way to the platforms.

This is where Consent Mode V2 plays a key role. Google requires advertisers in the EU to send consent signals along with their data in order to use features such as personalised advertising and remarketing. When set up correctly, the consent status is sent from the cookie banner, via the server, and on to Google.

Server-side tracking in Denmark

For Danish companies, there are a few additional factors to bear in mind.

In recent years, the Danish Data Protection Agency has focused on the use of analytics tools and the transfer of personal data to countries outside the EU. Where your tracking server is hosted therefore matters. When the server is located in Denmark or within the EU, you know where the data is processed before it is forwarded.

At the same time, your cookie banner must comply with Danish regulations, so that it is just as easy to say ‘no’ as it is to say ‘yes’, and so that consent is not pre-ticked. Server-side tracking in Denmark therefore works best as part of a comprehensive solution, where the cookie banner, consent and tracking are all integrated. If you are unsure about the legal details relevant to your business, you should have them assessed by a lawyer.

Which platforms support server-side tracking?

Most major analytics and advertising platforms can receive data via server-side tracking. The most commonly used ones are

  • Google Analytics 4, where server-side tracking provides more comprehensive data on visits and conversions.
  • Google Ads, where conversions can be sent from the server, ideally in combination with Enhanced Conversions.
  • Meta, where the Conversion API sends events directly from the server to Facebook and Instagram.
  • TikTok, Snapchat and LinkedIn, all of which have their own server-side interfaces.
  • Klaviyo, where server-side tracking ensures more reliable data for segments and email flows.

Server-side tracking also works regardless of the platform your website is built on, such as Shopify, WooCommerce or any other system.

Who benefits from server-side tracking?

Server-side tracking makes sense for most businesses that use data to make marketing decisions. However, some stand to gain a great deal.

Online shops

Online shops rely on purchases being recorded correctly and linked to the advert or channel that generated them. Even small gaps in conversion data can cause an advertising platform to scale back the campaigns that are actually driving sales. For online shops on Shopify and WooCommerce, server-side tracking is therefore often one of the investments that has the quickest impact on advertising results.

Companies with a large advertising budget

The more money you spend on Google Ads, Meta or TikTok, the more it costs when the algorithms optimise based on incomplete data. In this context, better conversion data can quickly make a difference to how much you get out of every advertising krone.

B2B and lead generation

Businesses that rely on enquiries submitted via forms often have long sales journeys involving several visits before the customer makes contact. When cookies expire along the way, you lose the connection between the initial advert and the final enquiry. Server-side tracking helps to maintain that connection.

Companies specialising in compliance

If you want to keep track of what data is being shared with whom, server-side tracking provides you with a central point of control. This is particularly relevant for businesses operating in sensitive sectors or with strict internal data protection requirements.

Common errors in server-side tracking

A server-side configuration is only as good as its details. These are the errors we most commonly see when a configuration fails to deliver the expected data.

Double conversions

When the same purchase is sent from both the browser and the server, the platform must be able to recognise that it is the same event. This requires both signals to have a common event ID, so that the platform can remove duplicates. If this is missing, the purchase will be counted twice, and your reports will show inflated figures.

Consent is not included

If the consent signal from the cookie banner is not sent to the server, you risk either sending data that you are not authorised to send, or blocking data for which you actually have consent. Both scenarios are problematic. Consent must therefore be an integral part of the setup from the outset.

Missing or incorrect data on incidents

Advertising platforms such as Meta assess the quality of the data you send, for example, whether it includes information that makes it possible to match the event to a user. If you send too little information, the platform cannot make optimal use of the conversion. If you send too much, you may breach data protection regulations.

No ongoing monitoring

The platforms regularly update their interfaces and requirements. A configuration that worked perfectly a year ago may now be sending incomplete data without anyone realising it. Tracking should therefore be monitored on an ongoing basis and not just tested at launch.

How much does server-side tracking cost?

The cost depends on how you go about it. If you do it yourself, you’ll pay for server hosting and spend time on set-up, testing and maintenance. The cost of hosting typically increases in line with the amount of traffic on your website.

If you choose a managed solution, you pay a fixed price for hosting, set-up and operation all in one. At WeTrack, prices start from 650 kr. per month with no long-term commitment, including a cookie banner and Consent Mode V2. You can calculate the cost of server-side tracking to your own website in under a minute.

How to get started with server-side tracking

Whether you want to do it yourself or get some help, the set-up process typically follows the same steps.

  1. Assess your needs. Find out which events are important for your business – such as purchases, leads and sign-ups – and which platforms they should be sent to.
  2. Choose a hosting plan. Decide whether the tracking server should be hosted on Google Cloud, with a specialist provider, or as a managed solution where everything is handled for you.
  3. Set up the server container and your subdomain. The server container is created, and a first-party subdomain is pointed to the server via DNS.
  4. Link the cookie banner and Consent Mode V2. Consent signals must accompany the data, so that you only track what the user has consented to.
  5. Set up tags for your platforms. Events are sent to GA4, Google Ads, Meta and other platforms, and deduplication is set up so that the same purchase is not counted twice.
  6. Test thoroughly. Check that events are recorded correctly across all platforms and that the figures match those in your backend system.
  7. Monitor and maintain. The platforms are constantly changing their requirements, so the configuration needs to be kept up to date.

At WeTrack, we handle the entire process for you, from setting up the server, the cookie banner and Consent Mode V2 to testing and ongoing maintenance, with hosting in Denmark.

Frequently Asked Questions

What is the difference between server-side tracking and server-side tagging?

The terms are often used interchangeably. Server-side tagging refers to the technical method whereby tags are moved from the browser to a server. Server-side tracking is the broader term for collecting and sending tracking data via a server.

Is server-side tracking legal?

Yes, server-side tracking is legal when used correctly. You still need to obtain consent for analytics and marketing, and you must comply with the GDPR and the Danish cookie regulations, just as you would with standard tracking.

Can server-side tracking bypass ad blockers?

Server-side tracking reduces the number of events that are blocked, as data is sent to your own domain. The aim is to obtain more reliable data from users who have given their consent. Users who have opted out of tracking must still be respected.

What is sGTM?

sGTM stands for server-side Google Tag Manager. It is Google’s solution for running a Tag Manager container on a server rather than in the browser, so that data can be processed and sent on from there.

Do I still need to use client-side tracking?

In most cases, yes. The most common solution is a combination whereby the browser collects the events and sends them to your server, which then forwards them to the platforms.

Get started

Would you like to see how server-side tracking can provide you with more reliable data and better advertising results? Book a free demo, and we’ll show you how the solution works on your website.

Thomas André Jensen is the founder of WeTrack and the founder and CEO of Versano. He established WeTrack based on the simple idea that marketing should be built on reliable data and deliver measurable results. On his blog, he shares insights on server-side tracking, consent and data quality.