Google Tag Manager was initially designed to make the life of marketers easier. If you use Google Tag Manager web container, you no longer need to ask developers to add tracking pixels and wait for the next update to see your tracking on the production.
Server-side Google Tag Manager tagging is more complicated than the web container set up, at least for now, since the idea and technology behind server tagging are entirely different from what we used to have on the web. But server-side tagging will give your site huge benefits. Server-side tagging is getting more popular due to its ability to track people using AdBlockers, browsers with ITPs, and other tracking restrictions.
The purpose of this article is not to convince you to start using server-side tagging (there is another blog post that describes the main benefits of server-side tracking). I assume that you’ve already decided to implement server-side tagging on your site. This blog post will show you how to check whether Server-Side tracking for Universal Analytics, GA4, and Facebook conversion API was set up correctly.
We will go through these methods: checking server-side tagging in Tag Manager server container debug mode, Facebook event testing tool, and developers tool inside your browser. Let’s get started.
I suggest starting with the Tag Manager preview and debug mode to ensure that your tags are triggering when they should. GTM debug tool will show you which tags and events were added to the site and whether they fired or not on particular pages/triggers.
Tag manager server container debug mode works similarly to web debugger. Just click the preview button on the top right corner. Then, navigate to the different pages and click on the button or perform events set up in the server container.
Return to the Tag Manager debugger and check which tags and events were triggered and if all required parameters were sent to the dataLayer. If everything works correctly, we can move to the next step.
GA4 has it's debug view that will show you all events, event parameters and user data that we processed by GA4. To find GA4 debugger click Configure -> Debug view.
To ensure that requests are sent from a custom tagging URL, you’ll need to dive deeper into the developer’s zone. We’ll need Chrome or Safari developer tools here (you can use other browsers as well).
On Mac, you can access the developer tool by clicking command+option+I or click the right mouse button, then inspect.
Once you’ve opened the developer tool, go to the Network tab and refresh the page. When inside the filter, type collect. You should see Universal Analytics and GA4 requests. Click on the UA or GA4 request, and on the right side, you will see additional parameters.
Bear in mind that you need to double-check if inside the Request URL you can see the tagging server URL; It is the one that you’ve added to the server container and inside Universal Analytics or GA4 variable or tag.
Note: cookies will be extended only if you are using a custom subdomain inside the tagging URL. For instance, your website URL is example.com. Then, the custom domain for tagging URL should look like gtm.example.com.
Go to the application tab inside the developer tool that you’ve used in step two. Click Storage-> Cookies. On the right side, you will find cookies named FPID; check the date in the column “expires”. This way, cookies should be extended up to 2 years. I am writing this post in February 2021, and my cookie will expire in February 2023. If you are not using server-side tracking and a custom tagging URL located under your main domain, Safari will decrease your cookie lifetime to 1 or 7 days. If you see that cookies were not extended, go to the Universal Analytics or GA4 client inside the server container, click more settings and check what Server Cookie Settings look like on the screenshot below. Or make sure that you are using a custom tagging URL that looks like gtm.youdomain.com.
The first step of testing Facebook server side tracking is the same as for Google Analytics. You need to make sure that events are firing on the correct triggers. Open the GTM debug tool, click through your site’s pages, and perform events you want to test. Once you’ve done it, go to the Tag Manager debugger tab and check the results.
First, make sure that the FB base pixel is firing on a pageview. If you see the tag status Fail, check outgoing requests. It should show the reason why tag was failed.
If you are using our FB server-side tracking tag, you have two options for sending FB events:
Open events manager inside your Facebook business manager and click on test events. You will see a test event code that you should add to our Facebook Tag inside Google Tag Manager. With the help of this code, you will be able to test Facebook server events in the realtime.
Once you’ve added a test ID, open your site and perform actions triggering your FB events. Then return to the Facebook testing tool and check the events it shows you. In the column “Received From” you should see “Server”. You can click on the event and see the recorded parameters.
Note that the Facebook pixel helper Chrome plugin you used to check FB browser events won’t work for conversion API. That is why you need to check everything inside the testing tool.
Note: cookies will be extended only if you are using a custom subdomain inside the tagging URL. For example, your site’s URL is example.com, then a custom domain for tagging URL should look like gtm.example.com.
The third step is again similar to what we did for Universal Analytics but has a few differences. To check the Facebook cookies expiration date, you first need to generate it. To do that, open your site and add fbclid.
Once you’ve done that open developers tools, go to storage and click on cookies. Check _fbc and _fbp were extended.
I hope that everything worked for you and you have managed to set up server-side tracking for Universal Analytics, GA4, or Facebook conversion API successfully. If not, this article should help you troubleshoot and fix your setup. If you have any questions, feel free to send us an email at firstname.lastname@example.org.
We can help you with anything! Click Get assistance, fill up the form, and we will send you a quote.
Setting up the Facebook conversion API may be confusing. But after you did the tremendous job of moving FB tracking to the server and think that job is done, you might log in to your events manager the next day and see red and yellow warnings. In this blog post, I will describe the most popular Facebook conversion API errors and warnings. Plus, share some tips on how to fix it.Sep 16, 2021
Find out how to use server-side tracking with Google Tag Manager and avoid being blocked by AdBlocker.