What is the biggest challenge to deploy Facebook CAPI using server-side GTM? The new Google Tag.
For the longest time, if you wanted to implement a Facebook (aka Meta) tag on your website, you would use the client-side browser pixel. However, as the need for privacy becomes more important and browsers introduce cookie limitations, advertising platforms like Facebook are shifting towards a server-side approach to allow for more robust data collection. This server-side data collection approach aims to enhance your conversion reporting despite browser restrictions. If you are not familiar, Facebook launched its own version of the server-side pixel called Conversions API aka CAPI.
According to Facebook, the Conversions API allows advertisers to send web events directly to their servers. These events will then be processed just like browser pixel events allowing them to be used in measurement, reporting, and optimization.
Apart from initiating web events through your client-side Google Tag Management platform using the browser pixel, this Conversions API will live on a server you manage with the help of Server-side GTM and send the same events to your Facebook account. This allows you to go around browser restrictions such as ad blocking and cookies. While it may seem redundant to have client-side and server-side tagging for the same events, you will send an event ID with both the client-side and server-side to de-dupe the same events.
While this might already sound like the best approach given the heavy browser restrictions, it is not without its challenges and Google-imposed limitations to overcome. In this blog post, we are going to see what challenges you may face while doing Facebook conversions API-specific events setup and how to solve the Google Tag limitations.
Perquisites you will need:
- GTM Client container – To send the events data from client(web) GTM to server GTM.
- GTM Server container – To get the server URL and to do server-side Facebook Conversions API configuration.
Requirement:
To track only a few e-commerce events from server-side META conversion API.
The Challenge:
The common mistake people make is using the existing Google Tag that deploys GA4 client-side, for deploying 3rd party pixels in GTM server-side.
Today if you are using only one Google Tag (Previously GA4 configuration tag) for both GA4 (client-side) and META Conversion API (server-side), you will face below impediments:
![]()
Alternates:
Our Solution:
Since the server-side setup didn’t work out with the Google page_view tag simultaneously, we used the Stape data tag and data client to send the data from the web container to the server container.
But we have to send only a few events based on dataLayer and not all events. So, let’s dive into how we did that:
- Select the Stape data tag from the Web- GTM tag templates gallery and set your server URL which you got from your Server container.


- Create a trigger with the below conditions to ensure the data call from web-GTM to server-GTM should only be sent on specific events to avoid sending all events data if not required.
- Download the Stape Data Client from here – https://github.com/stape-io/data-client. Go to your Server Container and add the “template.tpl” file that you downloaded from GitHub.




- Once you added the Stape data client template. Add the Facebook Conversion API tag template by Stape from the Server GTM tag template gallery.


- Now add a Facebook Conversions API tag and add your access token and Facebook pixel ID which is unique to your Facebook Business Manager account.


- The final step is to create a custom event trigger like below. use regex matching with value “.*”. This makes sure it looks for all events that are coming from the web container. The Stape data tag from the Web container will make sure the tag fires only on the specific events data that is being sent to the server container.


- To debug the server events in GTM preview mode, set both the Web and Server containers in preview mode to see whether the Stape data server calls and your Facebook conversion API tags are firing.


If you followed all the steps outlined in this blog post, then your META CAPI should be set up without any issues. If you enjoyed this blog post, then you can read more from our Digital Analytics practice here.