Proper Facebook conversion attribution is essential for businesses that want to take full advantage of paid advertising. While some companies still rely on browser tracking, shifting to server-side tracking can provide more accurate data and give you better insights. Server-side tagging enables direct communication between your server and the Facebook server, delivering quality first-party data and using first-party cookies.
Verifying event data Using Facebook's Events Manager tool is crucial for ensuring accurate reporting and optimization, guaranteeing the effectiveness of your strategies.
This blog post will provide actionable tips to help you improve your Facebook conversion attribution using server-side tagging.
Facebook conversion attribution is crucial to measuring the effectiveness of your Facebook ad campaigns. It allows you to track the actions taken by users after clicking on your ads, such as making a purchase or filling out a form. Understanding conversion attribution is essential to optimizing your ad campaigns and improving your return on investment (ROI).
Facebook uses various methods to track conversions, including the Facebook pixel, server-side tracking, and mobile app tracking. The Facebook pixel is a small piece of code that you place on your website to track conversions. It triggers events when specific actions are taken on your website and then sent to Facebook for tracking. On the other hand, server-side tracking sends data directly from your server to Facebook, allowing for more accurate and detailed tracking.
One of the main advantages of server-to-server (s2s) tagging is that it provides improved accuracy over client-side tracking methods. This is because s2s tagging can’t be blocked since the communication takes on the server level. Tools like AdBlocker or other tracking prevention mechanisms can’t access data sent through the server.
When you enable FB s2s integration, your server communicates directly with the Facebook servers, sending reliable data about events and users who visited your website. This confidence in your tracking methods helps Facebook accurately attribute your users to their FB profiles, leading to quality reporting and a higher chance of successful targeting.
The most popular way of server-to-server Facebook tracking is setting up Facebook Conversions API with the help of the Google Tag Manager server. However, there are several approaches to setting up FB CAPI in sGTM. |
To integrate the Facebook Conversions API Tag within a server-side Google Tag Manager setup, you must configure the tag, set the necessary parameters, and ensure the data flows from the website through the GA4 web tag to the Facebook server for efficient event tracking. In this guide, we want to describe different methods of setting up FB CAPI, how each way impacts FB attribution, and how to improve attribution.
These suggestions are based on Stape’s experience and Stape customers’ feedback.
Facebook recommends setting up CAPI using the browser+server method. When browser tracking is blocked, server tracking will still send user data to Facebook. When both browser and server tracking are triggered, FB uses the event name and ID for event deduplication. Event deduplication is a process through which Facebook identifies and removes duplicate events to prevent overreporting. It discards one event and keeps another to ensure accurate tracking.
Check out our blog post describing setting up Facebook CAPI using server GTM.
FB gives higher priority to browser events. When they see both browser and server events, their deduplication algorithm will likely discard server events and record browser events. So, if you send more data with a server event, FB won’t be able to read this data. They also do not combine web and server event parameters.
It is crucial to pass Facebook-specific parameters correctly to enhance Facebook tracking and ensure compliance with privacy standards.
An essential aspect of setting up FB CAPI using hybrid methods via Google Tag Manager pops up when you use GA4 (or any other GTM tag) to deliver data from the web to server GTM. In cases when AdBlocker blocks GA4, it does not provide data to sGTM, meaning FB CAPI tags also do not trigger. So, in this scenario, browser events and server tags do not trigger.
To solve this problem, Stape created a Custom Loader power-up. This power-up makes your GTM and GA4 script resistant to AdBlockers. So when AdBlocker uses its maximum capacity and blocks gtm.js or collects requests, Custom Loader hides them and prevents them from being blocked. This way, when the FB pixel is not working, your GA4 tag will still deliver data to the sGTM container, and sGTM will send FB CAPI events to Facebook, meaning user action is tracked.
On our blog, you can learn how to avoid Google Tag Manager being blocked by Adblockers.
Note: FB recommends setting up the browser+server method.
Advantages:
Disadvantages:
Though Facebook does not recommend sending only server events, it is a good solution if you have more user or event data in the server Google Tag Manager container than in the web one. You can also use any technique to enrich your server data. We already have two blog posts on how you can enhance sGTM data with the help of Firestore or Google Sheets.
It is essential to send user data parameters to improve user-matching capabilities while adhering to privacy regulations.
Another lengthy and controversial discussion concerns FB conversion attribution of iOS users who opted out of tracking. In the official documentation, FB says that FB CAPI does not help track users who opted out of search. However, some case studies and our experiment show that one way to track users who opted out of tracking on iOS is to send only server events through FB CAPI.
This theory is based on the logic that with web+server tracking, FB sees the device ID using pixel and does not collect all events for this device ID. However, when sending events through the server, FB only has access to data you configure and does not know the device ID or if the user opted out of tracking.
Advantages:
Disadvantages:
You can also enable Event Enhancement using an HTTP-only secure cookie (gtmeec) to enhance event data.
When this feature is enabled, the tag stores user data in cookies and enriches events with user data when user data is not available. This increases event match quality and, as a result, conversion attribution to campaigns.
Setting up FB CAPI through webhooks is similar to sending FB events only through the server. The only difference is how you deliver data from the web to the server. In method #2 (server-only tracking), you send data from web GTM to sGTM using GA4, UA, or Data Tag. With this method, you can trigger FB CAPI events based on the data you send via Webhooks.
The most popular CMS has functionality that allows users to configure webhooks easily. With the stape Preview Header power-up, you can easily debug incoming webhooks in sGTM. We already have a blog post on how to send webhooks to sGTM.
Webhooks can be an excellent data source for sGTM since they carry complete information about the order.
The main benefit of using webhooks to send FB CAPI events is that these events can’t be blocked. Some clients prefer to test sending the same event via browser+server vs. webhook (server only). They can compare which method has a higher match rate and better attribution.
Advantages:
Disadvantages:
How to set up Facebook offline conversions using sGTM:
1. In the server GTM, go to the section “Templates” → Tag Templates section → Search Gallery.
Add “Facebook Conversions API”.
2. Go to the Tags section → click “New,” → select “Facebook Conversions API” as Tag Configuration.
3. Configure the tag.
3.1 Choose “Event Name Setup Method”:
3.2 Choose the “Physical Store” as “Action Source” from the list.
3.3 Add “API Access Token” and “Facebook Pixel ID”
To find “Facebook Pixel ID,” go to your Business Manager → Events Manager → Data Sources → copy Dataset ID.
To find “API Access Token,” scroll down and find “Generate access token.”
That’s the basic tag configuration. If you want to send users or some custom data, you can set it up in the sections of the tag.
Below is an example of Facebook Conversions API Tag configuration:
4. Add the trigger.
Trigger Type: Custom Event
Event name: specify your event name (in our case, it is “purchase)
This trigger fires on Some Custom Events
Condition: Client Name equals Data Client
1. Open Preview and Debug Mode in server GTM.
2. Go to the WordPress Setting tab and click “Send test webhook.”
3. See the webhook in Preview and Debug Mode.
Don’t forget to debug your setup.
We have a guide on debugging incoming webhooks in the Google Tag Manager server preview on our blog.
Now that you know what tips we are using to help our clients improve their FB campaign's conversion attribution using server-side tagging, it’s time to put this knowledge into practice.
Remember that only some solutions fit websites since technologies and conversion funnels differ. Try to experiment and find a method that works best for you.
We are here to help if you need assistance setting up your tracking or troubleshooting any issues.
All it takes is a few simple questions. Click Get assistance, fill-up the form, and we will send you a quote.