Back to blog

Server-side analytics tracking with first-party collector: What you need to know

Analytics

Written by

Published May 30, 2022 · Updated January 16, 2024

Server-side analytics tracking with first-party collector: What you need to know

For years, companies have been using third-party tags and pixels to track website visitors, improve the user experience, and collect data that helps target ads to the right audiences. Now, these trackers are slowly becoming a thing of the past.

With the increasing popularity of ad blockers and browser restrictions such as intelligent tracking prevention (ITP) in Safari or the improved tracking protection of Firefox, third-party tracking becomes less effective and reliable. There are also laws that limit and regulate the use of cookies and tracking technologies, such as PECR in the UK and TTDSG in Germany.

As companies are trying to get more accurate data on user behavior, they are exploring alternative methods for data collection. More and more people are using server-side tracking and tagging to solve problems with third-party and client-side first-party tracking.

In this article we will:

If you’re interested in the details behind data collection, read our article: 6 ways analytics software collects data online

What is server-side analytics tracking

Server-side tracking methods allow sending the collected data to a server that hosts your website or app, and then passing it to a destination endpoint, such as your analytics platform. The concept becomes easier to understand, when you compare it to the standard client-side analytics tracking.

Server-side tracking vs. client-side tracking

Server-side and client-side tracking are methods used to move data collected from a browser to an analytics platform. Those two ways measure how users interact with your website or app. The difference is in how the data is collected.

What is client-side tracking?

Client-side tracking is the most common way of implementing analytics and other third-party tags. With client-side tracking, data is transferred directly from the user’s browser (known as a client) to an external server such as your analytics instance (for example: yourwebsite.piwik.pro). This data transfer is enabled by deploying small pieces of JavaScript code (called tags) on each page of a website, typically with the use of a tag management system.

Because in this kind of tracking the call is made from the browser, it gives you easy access to a lot of contextual browser and user information, such as:

  • Cookies
  • UTM parameters
  • IP address 
  • User agent
  • Referrer

For a long time, client-side tracking was the preferred way to collect data – but this is starting to change. It’s clear that with the phase out of third-party cookies, tracking client-side has increasing effect on data accuracy. 

Browser mechanisms like ITP limit the lifespan of cookies, prevent fingerprinting and CNAME cloaking, which means that the information we get becomes more fragmented. Adding to that, 37.5% of global internet users block tracking technologies with an ad blocker tool. 

CNAME cloaking is a method used to disguise a third-party domain as part of the first-party domain, allowing the third party to track as a first party. CNAME cloaking lets third-party trackers avoid ad blockers for data collection and tracking.

So, the obvious downside about client-side tracking is have less control and accuracy. 

The methods of server-side tracking

Server-side tracking involves the server sending a request to the final destination, such as analytics, rather than a direct request from the client, such as user’s browser. This creates an additional layer between a website and a data collection platform, providing increased security and control.

Server-side tracking is a more accurate method of data collection as it is not affected by ad blockers or intelligent tracking protection (ITP). Because of that, it’s perceived as a more reliable option compared to the client-side method.

Although the concept of server-side tracking might seem new, it dates back to the early 1990s when website analytics revolved around counting the client requests or hits made to the web server and recording them in log files.

Analysts soon realized that these log files could also be used to provide data on the website’s popularity.

Log analytics is the oldest server-side tracking method. Another still commonly employed server-side tracking method is with the use of SDK/API. Let’s have a look at both of them.

Log analytics

Log analytics is a process of analyzing log data from your website. You can import server-side logs using specialized software that works with the web server. This method lets you retrieve records that match particular criteria, identify trends, and analyze patterns.

The information collected through server logs is relatively limited compared to the data collected through client-side JavaScript, which provides more in-depth insights. Server logs lack essential data points such as browser plugins, screen resolutions, and page titles that may be useful. Additionally, it can be challenging to identify visitors as server logs do not store information about cookies set in the user’s browser.

Server-side tracking with the use of SDK/API

Another earlier method for server-side tracking involves gathering information about users and their interactions within apps or server backends using dedicated APIs or server-side tracking libraries.

In modern analytics products, a tracking HTTP API is usually available if interactions and user details can be sent manually from the backend of your application. This method is time-consuming and requires software development resources as well as certain expertise.

Server-side analytics SDKs provide an easier way of sending data to those APIs by offering a set of tools that developers can use to implement tracking in the app automatically.

However, using server-side libraries can be quite complex and demands additional development effort. Although it is more straightforward than utilizing the HTTP API for transmitting events, it’s still a significant and time-consuming task that requires developers’ expertise. This approach may be more suitable for businesses with a larger and more advanced development team.

Server-side tracking with first-party collector – a more modern and convenient way of server-side analytics

During the last few years, there have been significant changes in the world of server-side tracking. As a result, we now have more methods to choose from. On top of that, the newer methods are far more convenient than the old ones. Among the modern methods, server-side tracking with a first-party collector stands out due to its advanced capabilities. In the following section, we will delve into its details.

Server-side tracking with first-party collector: The hybrid method

In server-side tracking with a first-party collector method, the collected data is sent to a reverse proxy server hosted on the same server as your website or app. The data is then passed to your analytics instance.

This means that cookies are set from your proxy server within the main website domain. The requests come directly to your domain, not a third-party analytics platform. As a result, server-side tracking is undetectable in browsers and not blocked by ad blockers.

This method makes it easy for you to collect all customer behavioral data and use tools such as a tag management system to configure tracking events. Additionally, it offers the same data quality as client-side trackers, and even better if you consider the ad blocks and browser restrictions.

We can call it a hybrid model — combining the benefits of client-side data collection and server-side logic and dispatch.

With server-side tracking using a first-party collector, implementation is as easy as with client-side tracking, and at the same time you can immensely improve data accuracy and data control. With server-side tracking with first-party collector you can:

  • Still collect data like in a client-side mechanism.
  • Avoid using server-side Google Tag Manager or involving Google servers.

Why server-side tracking with first-party collector is the future of web analytics

Server-side tracking with the use of a first-party collector puts an end to the search for the optimal way for complete and privacy-friendly data collection on websites. The advantages of this method include:

  • Higher data accuracy – ad blockers and intelligent tracking protection (ITP) have minimal or no impact on your data.
  • Higher data security – it’s a safe method for tracking sensitive data and recreating the whole customer journey (including post-login areas).
  • Rich and high-quality data collection – it offers the same sata granularity as with client side tracking: traffic sources, referring sites, page views, paths taken, conversion rates, real-time data, browser data, scroll depth, custom events.
  • Ease – it ensures a hassle-free implementation. It doesn’t require special skills and resources.
  • Lightweight – it doesn’t require implementing a separate platform (server-side tagging) or on-premises deployment of large components.

For all these reasons, the server-side method offers a great alternative to the increasingly unreliable client-side tracking.

What is server-side tagging?

Google Tag Manager and other tag management systems introduced in recent years, such as Piwik PRO Tag Manager, allow to optimize the number of requests sent from the web browser to different marketing tools.

A typical client-side tagging configuration relies on a component in the page to send data to various collection servers.

By contrast, a server component doesn’t run in the user’s browser or on their phone. Instead, it runs on a server that you control. In this method a single JavaScript snippet collects data from the web browser and pushes it to a server-side component. Then the server-side component sends the data server-side to the selected services, including analytics, ad platforms and other marketing tools.

With a server-side component, the web browser sends just a single request and you can control which data is shared with which service. It allows you to limit your data collection and control how much data you share with third parties. 

Moreover, server-side tagging allows you to move measurement tag instrumentation from your website or app to a server-side processing container on the cloud, or any other external platform you choose. This results in improved performance. See the advantages below.

Advantages of server-side tagging:

  • Improved performance: It can improve performance of your website for certain slow connections and mobile devices in case you have many vendors that you share data with.
  • Better data protection: User data is better protected when collected and distributed in a customer-managed server-side environment (you can select which data is shared with specific vendors). 
  • Additional layer of security: No unauthorized JavaScript code will be executed on the site by any of the vendors.
  • Control: You can mask or remove certain data (e.g. IP address or browser user agent), so that vendors won’t receive full information about visitors.
  • Speed: In server side tagging, the processing burden is moved from a consumer’s device, which leads to increased application and device performance. The faster the application and website performance, the higher the conversions.
  • Data enrichment: You have the option to enrich incoming data with relevant additional information, using systems such as CRM and tag manager.

Server-side tracking: What you need to consider

Server-side tracking is not a new phenomenon. It has made a comeback as the only sustainable solution to the impending end of client-side tracking. However, there are certain things you need to consider.

You should remember that although server-side trackers and tags are undetectable in browsers, you still need to follow the same compliance rules as with client-side tracking. That is, collect applicable consents for the use of cookies, document your data collection methods in your privacy policy etc.

At the same time, server-side tagging solutions generate a client/visitor ID, and this is personal data that requires consent under GDPR in EEA, PECR in the UK or TTDSG in Germany. The client/visitor ID may be encoded, which adds an additional privacy protection layer, but it’s still considered pseudonymous data (and hence falls under regulations as personal data). This means it’s a type of data you can collect only with the visitor’s consent. 

Read more in the article Is Google Analytics GDPR-compliant?
Find out more about privacy-friendly analytics in What is privacy-friendly analytics?

Dedicated support

If you don’t have the internal resources to handle server-side tracking, you might decide to choose an analytics vendor that offers dedicated support and customer care. This can help you not only get started but also give you support with everyday maintenance of your server-side tracking.

Comparison of web analytics platforms that offer first-party data collection and server-side tracking

The phase out of third-party cookies and other restrictions undoubtedly affect the way businesses collect and use data. The good news is that there is still time to take action. Most marketers are already looking into different vendors to fill the void left by third-party cookies by building a consented first-party data asset. 

We have prepared a comparison of web analytics platforms that offer first-party data collection.

Piwik PRO Enterprise Google Analytics 360 Matomo Adobe Heap Analytics Segment
Client-side tracking
Server-side first-party tracking
only through HTTP API
Server-side tagging
GTM integration
Dedicated account manager and tech support
Integrated consent management system
Compliance
Suitable for industries handling sensitive data: banking, governments, telecoms and healthcare

Author

Aleksandra Szczepańska

Senior Content Marketer

Aleksandra is a senior content writer for Piwik PRO’s marketing blog, copywriter, content creator, and former lecturer on content marketing. With 10 years of experience in marketing, she has effectively juggled branding, marketing strategies, and content creation. She uses SEO best practices and digital marketing strategies to help articles rank high. Aleksandra values the impact of a compelling experience in content and employs various techniques in her writing to deliver valuable insight and engage with readers.| LinkedIn Profile

See more posts by this author

Core – a new plan for Piwik PRO Analytics Suite

Privacy-compliant analytics, built-in consent management and EU hosting. For free.

Sign up for free