3 Easy Steps to Test Server-Side Universal Analytics/GA4 and Facebook Conversion API

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 you site huge benefits. Server-side tagging is getting more popular mostly because it helps to track people who use Ad Blockers, 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 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 if 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 is installed correctly

1.1 Use Google Tag Manager Server 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 what tags and events were added to the site and if they fired and not fired 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. 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 what tags and events were triggered and if all needed parameters were sent to the dataLayer. If everything works correctly, we can move to the next step.

server tag manager debug mode for ua

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 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.

tagging url check developers tool

Once you’ve opened the developer tool, go to Network tab and refresh the page. 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. 

You need to make sure that inside the Request URL you see the tagging server URL that you’ve added to the server container and inside Universal Analytics or GA4 variable or tag.

tagging URL for Universal Analytics

1.3 Check that cookies were extended.

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 custom domain for tagging URL should look like gtm.example.com

Go to the application tab inside the developer’s tool that you’ve used on step two. Click Storage-> Cookies. On the right side, find cookies named FPID and check the date in the column “expires”. Cookies should be extended to 2 years. I’m 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 that is located under your main domain, Safari will decrease your cookie lifetime to 7 or 1 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 that Server Cookie Settings looks like on the screenshot below. Or make sure that you are using custom tagging URL that looks like: gtm.youdomain.com

extended cookies universal analytics client server

Test Facebook Conversion API implementation.

2.1 Use GTM server debug tool to verify that base code and FB events 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, go to the Tag Manager debugger tab and check the results. 

First, make sure that FB base pixel is firing on a pageview.

If you are using our FB server-side tracking tag, you have two option of sending FB events: 

  • inherit from GA client. In this case, we automatically match UA events to FB standard events. If we cannot match UA event into a standard FB event, we’ll add it as a custom event. If you are using the inherit option, you will see only FB base tag inside GTM debug mode. 
  • Override. If you selected override option, you would need to set up FB server events inside the server container manually. It will be visible in the server debug mode.
facebook tag gtm server

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
https://www.online-toolz.com/tools/text-unicode-entities-convertor.php

facebook server tag failed

2.2 Facebook testing tool for Facebook conversion API

Open events manager inside your Facebook business manager and click on test events. There 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.

facebook server testing tool
facebook conversion api tag

Once you’ve added a test ID open your site and perform actions that will trigger your FB events. Then return to the Facebook testing tool and check what events it shows you. In the column “Received From” you should see “Server”. You can click on the event and see what parameters were recorded. 

Note that Facebook pixel helper Chrome plugin that you used to check FB browser events won’t work for conversion API, 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 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 expiry 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:

?fbclid=IwAR1Y_o01bzRrfguyqxMG3IDAH1w1E4beskjlP3Hwg7rxIQnxE51Rb3vi8mw+aem_AYmjtColl1ovygS0j8SyofoUSt6ED_pL_jfSO6ZaFsIDyeiMoLk5cjqjl0kXveC9Mnukg-tXf8pqKUm6IJzkytcPLHmPdubDT0kawjP8tKaj7_NILjJ-BzG0

It’s a click ID that Facebook uses to track users. The full URL should look like:

https://wp-demo.gtm-server.com/?fbclid=IwAR1Y_o01bzRrfguyqxMG3IDAH1w1E4beskjlP3Hwg7rxIQnxE51Rb3vi8mw+aem_AYmjtColl1ovygS0j8SyofoUSt6ED_pL_jfSO6ZaFsIDyeiMoLk5cjqjl0kXveC9Mnukg-tXf8pqKUm6IJzkytcPLHmPdubDT0kawjP8tKaj7_NILjJ-BzG0

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.

extended facebook cookie

Conclusion: hope that everything worked for you and set up server-side tracking for Universal Analytics, GA4 or Facebook conversion API successfully. If not this article should help you to troubleshoot and fix your set up. If you have any question feel free to send us an email support@gtm-server.com