Stape

Facebook offline conversion using server GTM

Updated
Aug 18, 2022
Published
Aug 16, 2022
Also available in

Facebook advertisers are always looking for ways to improve their campaign efficiency. One way they do this is by enhancing conversion tracking, which has not been an easy task in recent years. 

Since the rise of tracking restrictions, implementing Facebook Conversion API (which sends data to FB servers from your server) is the most popular way of improving FB tracking. We already have a detailed blog post on how to set up FB CAPI

You can also use Facebook’s older way of sending server events, the offline conversions. This solution relies on first-party data that cannot be affected by tracking restrictions or short-lived cookies.

This blog post will discuss the recent tag for the server Google Tag Manager container - Facebook offline conversion tag. It allows sending data to FB offline conversion using the server Google Tag Manager container. 

What is Facebook offline conversions?Copy link to this section

Facebook offline conversions is a great way to track actions that people take off your site, such as in-store purchases or by phone.

You can upload offline event data to Facebook, which will match events to people who saw or clicked FB ads. If FB can identify a person and match them with the ad, it will count the event as a conversion towards the ad campaign. 

Nowadays, the conversion funnel is complicated and includes many touchpoints (both click-through and view-through). For this reason, some marketers choose offline conversions as their second angle of analysis when evaluating results from Facebook campaigns, both offline and online.  

There are several ways how advertises approach setting up FB offline conversions:

  • Manual upload using a CSV file
  • Built-in a custom integration
  • Connectors like Zapier

Each of these methods has its disadvantages. To implement custom integration, you need to hire developers who will create a connector for your CRM (or POS, etc.) and FB offline conversion. With tools like Zapier, it might be easy to set up, but the price will be high, especially if there are many events. With manual upload, a lot of work must be done when preparing a CSV file. 

Setting up FB offline conversions using the sGTM tag might be the best solution for those already familiar with server-side tagging. Setting up won’t take long, and you can save money by not using connectors or hiring developers.

If you are unfamiliar with server-side tagging, I highly suggest starting to implement this new technology sooner than later. The idea of server-side tagging has been around for some time, but it's only recently becoming more popular. This technology is designed for tracking that relies on first-party cookies and first-party data, making it more secure for your and your customers.

Two essential things that need to be done before setting up ss tagging using sGTM are creating a server GTM container and delivering data to sGTM (there are several ways of sending data, the most popular are GA4, DataTag/DataClient, Webhooks, etc.).

Why use Facebook offline conversions?Copy link to this section

There might be multiple reasons to use Facebook offline conversions. 

  • Measure events more accurately
  • Create quality custom and lookalike audiences
  • Optimize campaigns towards the best performing ads and ad sets
  • Increase ROAS of FB campaigns

But if you have already implemented FB CAPI? Should you consider implementing FB offline conversions using sGTM?

I would suggest doing so. The main reason is that the more data about customers you send to Facebook, the more information is fed to FB machine learning algorithms that select who should see your FB ads. This may have a positive effect on the results of FB ads. 

What about FB offline conversions and iOS tracking restrictions? There is no official documentation on how FB offline conversion affects those who opted out of tracking on their mobile phones. Below I will describe my opinion on how FB processes such data. 

This guide will use a CRM webhook to trigger FB offline conversion tags. When a user on iOS devices who opted out from tracking makes a purchase, FB pixel won't record this event (at least they should not track it following user privacy policy rules). 

After a user makes a purchase, CRM sends a webhook to sGTM with all the information about order details and user information. Once sGTM receives this data, it sends a request to FB offline conversion. In the webhook data, there will be no identification of whether the user allowed/not allowed FB to track them. In theory, this means that if FB can match this user with the person who saw your ad, the offline conversion will be counted towards the result of the FB campaign.  

Another massive benefit of FB offline conversion is that it’s still eligible for a 28-day attribution window. While with FB pixel or FB CAPI, the maximum you can get is 7-day attribution. 

Send data to sGTM using webhookCopy link to this section

1. Open sGTM container preview -> click three dots in the top right corner -> click Send preview manually -> copy X-Gtm-Server-Preview HTTP header

http preview header sGTM

2. Log in to your stape account -> open sGTM container -> go to Power-Ups tab -> Click config HTTP Header Config -> paste the value you’ve copied from server Google Tag Manager container preview -> click Save. 

Once you've added the HTTP Header, you can see webhooks in the sGTM preview. 

Do not forget to remove the HTTP Preview header power-up once you finish the setup.

send request to sGTM preview

3. In this step, I will set up webhooks that send data to sGTM. Go to your CRM (in my case, it’s WordPress).  Add webhook name and webhook URL. Use your tagging server URL as a webhook URL+custom path (you can find tagging server URL inside the sGTM container settings on stape). Configure the webhook data you want to send. 

send webhook to sGTM

4. Open sGTM container preview and test webhook. You should see the corresponding request in the sGTM debugger.  

debug webhook sGTM

5. Let’s set up a client in sGTM that will claim the request sent by webhook. To do so, you must import Data Client to your sGTM. Once you’ve added Data Client to the sGTM client template, go to the Clients section in sGTM -> Click new Client -> Select Data Client and scroll down to Accepted Path Settings -> Add request path of your webhook. Save client. 

set up webhook sGTM

6. Open the sGTM debugger and test if the Data Client claimed webhook requests correctly. Check event data. You should see all the information you’ve configured in the webhook. 

webhook sGTM

How to set up Facebook offline conversions using sGTMCopy link to this section

Before July 2023, Offline Conversions API was used to send data to Facebook Offline conversions. But now things are getting way easier because of the update Facebook Conversions API. 

If you we using Stape’s Facebook Offline Conversion Tag that is now depreciated, in July 2023 your events may have stopped coming in, and when debugging you get an error like this:

events stopped coming

As the Offline Conversions API will soon be completely discontinued, we'd recommend going straight to reporting via the updated standard Conversions API, especially as it's become easier and more logical. 

Previously you sent Offline conversions to a separate Offline Dataset, this is no longer necessary as instead of the standard FB Pixels you now probably have a 'Dataset' which is essentially the same thing and most pixels have been automatically converted to Dataset, which you may not have even noticed :)

And so, for FB Offline reporting, it is now mandatory to use exactly Dataset, not Pixel. In most cases if you go to your pixel and check - you will notice that it has already become a Dataset. 

The easiest way to check this is to simply go into the settings and make sure you have 'Dataset ID' instead of 'Pixel ID' (the number remains the same):

dataset id

If in your case you still have a pixel - you can find instructions on how to convert FB Pixel to Dataset or create new Dataset here.

And so, we made sure that you already have a Dataset, now it remains to configure the sending of offline events, which is actually no different than configuring standard FB events.

Previously, we added an update to the Facebook Conversion API tag for the server container. In addition to switching to the new version of the API, an item with an Action Source selection has also been added to the interface:

facebook capi tag fo server container

And yes, to send an event as offline - all you have to do is select Physical Store in Action Source. 

Case exampleCopy link to this section

So, let's assume that we have a CRM system in which the company's clients are kept. Some sales happen on the website and we already have online conversion sending set up, but also some sales happen via email or phone, or in the physical shop. For such sales the user does not go through the standard online flow, so the only option for us is to ask developers to set up a webhook in JSON format which will be sent to our server GTM container when for example a customer card goes to Done status which means the transaction is closed.

It is extremely important that the webhook contains as much user data as possible, as this is the only source from which the event can be attributed to your adverts (as there is no fbc cookie).

The data in the webhook does not need to be hashed, the tag itself will do it automatically before sending the event.

!

If in your case, for example, a user leaves a lead request on your website before an offline sale, you can store his marketing click cookies (for Facebook, these are fbp and fbc cookies) in your CRM system along with the lead data. In this case the webhook can also contain data from these cookies and attribution for such events will work much better.

For webhook debugging, you will need to use Stape Power-UP 'Htttp header', we have described how to send and debug webhooks in sGTM earlier in this blog post. 

Further setting is no different from setting up a standard event.

1) Map the data from Event Data into the format required by Facebook.

2) Add the corresponding variables to the Facebook tag and select Action Source: Physical Store (this very point and send the event to the offline type).

facebook conversion api tag configuration

3) Add the correct trigger.

In my example, I use Data Client to get the webhooks (and I recommend you to do the same).

Data Client has a handy option - additional path. I always use this for webhooks to make sure there are no false positives fires from other tags. I use the /webhook path for webhooks, which means that developers send webhooks to my container https://gtm.example.com/webhook.

And accordingly I can use a simple trigger for my event with additional validation:

trigger in the custom event

It remains to make sure in debug mode that the tag worked and Facebook accepted the data and you can publish the update to live.

debug mode for the tag

And you should subsequently see events with the Offline type in your Dataset in both the overall list and in the event details:

dataset
dataset

And so, now setting up Offline events is no more complicated than standard Facebook events, also now it is more convenient to track all events, as now everything is collected in one place - in a single dataset.

The aim is to enhance your tracking capabilities and give you more insight into your offline conversions. This, in turn, can help improve your marketing strategies and drive better results for your business.

Conclusion:Copy link to this section

Facebook offline conversion is one of the ways to boost your FB campaign results and improve attribution. Though offline conversions only are not enough for proper FB tracking and audience collection, it might be an excellent addition to your existing FB pixel tracking and FB CAPI. 

Using FB offline conversion tag for the sGTM container, you can now set up offline conversion easier and cheaper than before. Remember to follow offline conversion best practices to improve the efficiency of your setup. 

If you need help setting up ss tagging, we are here to help!

Need help with setting up server-side tagging?

All it takes is a few simple questions. Click Get A Quote, fill-up the form, and we will send you a quote.

Get a Quote
Tagged with:Facebook

Relevant posts

Updated Mar 15, 2024

Debug incoming webhooks in Google Tag Manager server preview

One of the ways to use server-side tracking is sending data directly from your server endpoint to the server GTM container. This guide will show how you can send requests to the GTM server container with webhooks and how to see and test webhook data in the server Google Tag Manager container. We’ll also go over some common scenarios where it makes sense technically and practically speaking.

Updated Mar 27, 2022

How to Setup Facebook Conversion API + Events Deduplication & Hash User Data

Facebook Pixel allows you to track what users are doing on your site, collect remarketing audiences and create lookalikes. If the Facebook pixel is implemented correctly, it will feed relevant information to FB machine learning algorithms. FB ML will use pixel data to show your ads to people who are most likely to convert. For several years now, we could track events on the site via javascript code, Facebook SDK inside apps, or upload offline events. But how can you track users who installed Ad Blocker or track events outside the site? Or how can you extend a cookie lifetime? It can be done by implementing Facebook conversion API. This article will show you how to set up Facebook conversion API via Google Tag Manager Server Container.

Updated Mar 21, 2024

How to set up Google Tag Manager Server Container

Collecting data about your website visitors is critical for analyzing and improving the online business presence, reaching users, and converting them into customers. However, collecting data is becoming more problematic because of Intelligent Tracking Prevention, AdBlockers, and a decrease in cookie lifetime. Google Analytics and other similar tools will start seeing fewer data about your website visitors and giving you less information to analyze.

Host your GTM server at Stape