After Google released its new feature called first-party mode, a lot of questions arose about its advantages and differences compared to server-side tracking. At first glance, both look pretty similar. So, in this article, we will review the first-party mode as a tracking method, explain how it works, and whether you will benefit from such a setup.
The first-part mode is the feature released by Google that allows you to deploy Google tags using your infrastructure. Your infrastructure is servers/systems supporting data rerouting that belongs to you. Below, we consider what own infrastructure means in the context of first-party mode.
This way, you can avoid interacting with Google’s domains (such as https://www.googletagmanager.com/) when fetching measurement libraries and tracking users’ behavior on your website. First-party mode allows website owners to interact with Google's services through their own domain.
While setting up first-party mode, you specify the URL path, aka a subfolder (e.g., https://www.yourdomain.com/tracking) to load the Google tag. When someone interacts with your website (clicks a button, scrolls, etc.), the request will be made to that path.
Then, your Content Delivery Network (CDN), loader balancer, or web server forwards this request to Google services like GA4.
The difference lies in how the requests are proceeded:
First-party mode isn't an innovative solution for data tracking. If you use server-side tracking and have configured it with the same-origin custom domain in server GTM, you already use a similar to first-party mode setup. Let's dive into detail to see the difference between tracking methods.
At first glance, it looks like both first-party mode and server-side tracking are equally effective in reducing the impact of ad blockers, as both send the requests to the tag serving path (in the case with first-party mode) or the custom domain (in the case with server-side tracking).
However, the first-party mode's ability to deal with the ad blockers' impact is lower since the ad blockers are constantly improving, and some of them can already block the requests if the path or query parameters contain specific values that point out data tracking.
Find out more on how you can avoid blocking GTM in our another article. |
Forwarding traffic through a service you control (CDN, load balancer) as in first-party mode provides additional control. You can set up removing some data from the request, such as the user's IP address, but unlike with server-side tracking, you can't set up some conditions for such removal.
Server-side tracking provides a higher level of control in this matter. You can configure the setup to help comply with data protection regulations.
First-party mode is a suitable solution if you use only GA4 and Google Ads for tracking. But in case you also use other platforms like Meta, TikTok, Snapchat, Klaviyo, etc., it is better to choose a server-side tracking setup to get precise data. After switching to server GTM, you can have a signal from GA4 and use it to send data to any other platforms or set up server tracking for each platform in the future.
First-party mode is the cheaper option, as you can continue with your web GTM setup that doesn't cost a dollar. But it has some pitfalls. For example, if you set up first-party mode with the help of Cloudflare, you need to have an expensive Enterprise subscription.
Server-side tracking may seem expensive; however, if you have fewer than 10,000 requests per month, you can have it for free with Stape. In addition, hosting on Stape is cheaper than directly on the Google Cloud Platform, which can save you money.
You need to have the following for the setup:
Google documentation provides detailed instructions on setting up first-party mode using Google Cloud, Cloudflare, or other CDN/load balancers. Below, we consider the setup in a nutshell and take Cloudflare as an example. |
Choose the specific URL path that will load the Google Tag. It can be "/tracking", "/metrics", "/analytics" or any other word.
Note
Note
In the example with Cloudflare, you need to:
2.1 Go to DNS section → Records → Add record. Add the following configurations:
Type: CNAME
Name: fps
Target: <your GTM ID>.fps.goog
2.2 In the tab Origin → Origin rules, create a rule and name it "Route measurement" to make sure that the request is routed to Google after it comes to your tag serving path.
Replace the scripts with new ones on every website page to enable loading Google tags from your serving path instead of from https://www.googletagmanager.com/.
To test whether everything works, run preview mode and trigger events on your website. If everything works correctly in the "Hit Details", you should see the tag serving path you created in the first step.
First-party mode isn't a new solution in the world of data tracking; you could have a similar one with the help of a same-origin custom domain in server GTM. The main benefit of first-party mode setup is its price (if you use Google Cloud instead of Cloudflare, which requires an Enterprise subscription). However, in other criteria (such as resistance against ad blockers, data security, and control over data), server-side tracking is a winner.
Stape has lots of tags for server GTM! Click on Try for free to register and check them all.