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.
Google released a Server-Side version of Google Tag Manager in 2020. Server-side tracking 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.
Check if Universal Analytics and GA4 server-side tracking are installed correctly:
1.1 Use Google Tag Manager Server-Side Container Preview and Debug Mode.
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.
Once you’ve done that, open developer tools, go to storage, and click on cookies. _fbc responsible for FB cookies. Unlike UA, Facebook cookie lifetime should be six months.
1.2 Check if Universal Analytics and GA4 send requests from the correct tagging URL.
To ensure that requests are sent from a custom tagging URL (via the cloud server), 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.
1.3 Check if cookies were extended
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.
Test Facebook Conversion API implementation.
2.1 Use the GTM server debug tool to verify that base code and FB events are triggering correctly.
The first step of testing Facebook server side tracking is the same as for Universal 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 are using our FB server-side tracking tag, you have two options for sending FB events:
- Inherit from GA client. In this case, we automatically match UA events to FB standard events. If we cannot match the UA event to a standard FB event, we’ll add it as a custom event. If you are using the inherit option, you will see only the FB base tag inside GTM debug mode.
- Override. Selecting the override option requires setting up FB server events manually inside the server container. This way, it will be visible in the server debug mode.
If you see Facebook tag status “Failed” inside the Google Tag Manager server container preview mode, you need to check why it was not triggered successfully.
To do that, click on the Request tab -> under Outgoing HTTP Requests click on Facebook request -> Scroll down and check Response Body -> use one of the decoders to understand the error message. For example, this one
2.2 Facebook testing tool for Facebook conversion API
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.
2.3 Check that Facebook cookies were expended.
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 something that looks like this at the end of your site URL:
It’s a click ID that Facebook uses to track users. The full URL should look like this:
Once you’ve done that open developers tools, go to storage and click on cookies. _fbc is responsible for FB cookie. Unlike UA, Facebook cookie lifetime should be six months.
Conclusion: 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 email@example.com.