Stape
Search
Try for free

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

Updated
Sep 10, 2024
Published
Feb 6, 2021
Also available in

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 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 GA4 server-side tracking is installed correctly:

This video shows how to test server-side Google Analytics👇

1.1 Use Google Tag Manager Server-Side Container Preview and GA4 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.

test GA4 in google tag manager 

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. 

use Google Analytics 4 debug view 

1.2 Check if GA4 send requests from the correct tagging URL.

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.

test google analytics in console

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  GA4 requests. Click on 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 GA4 variable or tag.

1.3 Check server-side cookies.

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 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 google analytics server-side cookies

Test Facebook Conversion API.

This video shows how to test Facebook conversion API👇

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

test Facebook capi in server Google Tag Manager

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 GA events to FB standard events. 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.

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. 

Facebook event deduplication event testing tool

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

check fbp and fbc cookies

Conclusion:

 I hope that everything worked for you and you have managed to set up server-side tracking for 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 support@stape.io

Try Stape for all things server-sideright now!