Facebook offline conversion using server GTM

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. 

How FB offline conversion tag for sGTM worksCopy link to this section

The logic of the FB offline conversion tag is exceptionally similar to the stape's FB conversion API tag. But there are some additional parameters and steps required to set up FB offline conversion tag that I will cover later in this article.

Facebook offline conversion server GTM

Event Name Setup Method - select from the list of standard events, add a custom event name, or choose to inherit from the Client. If you decide to inherit from a client, then FB offline conversion tag will parse the event name from the Client that triggered this event. 

API Access Token - use the FB events manager to generate an FB access token for your account. See here for more information.

Offline Event Set ID - open Facebook Business manager settings -> Data Sources -> Offline event set -> open required event set and copy event set ID.   

Upload Tag - Track your event uploads. Example: monthly, in-store uploads. This field is required. 

Namespace id - Scope used to resolve extern_id or tpid. It can be another data set or data partner ID. Example: 12345. Optional field. 

Server Event Data Override - select from the list of standard event properties: event time, currency, value, content type, contents, order id, and item number. 

User Data - select from the standard user parameters: email, phone, gender, date of birth, first/last name.

Custom Data - add any custom data. 

Logs Settings - select if you want to use stape logs to debug your setup. 

What you’ll need to set FB offline conversion tag for sGTMCopy link to this section

2. Data delivered to your sGTM container. I will use CRM webhooks in this article to trigger FB offline conversions. The steps of setting up webhooks in sGTM will be described later in this article. For a more detailed guide, click here

3. FB app. I will show how to create it in FB business manager later in this blog post. 

4. Offline event set in FB business manager. 

5. Facebook system user with manage permission to app and offline event set id. I will also cover it in this how-to. 

How to set up Facebook offline conversion using server GTMCopy link to this section

If you do not have a server GTM container set up and running, start with this guide and switch back to the steps below.

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

2. Create FB appCopy link to this section

1. Go to the Facebook Business Manager Settings -> open Accounts -> select Apps -> click create new App -> Select Business -> Add app name and select Business manager -> click create. You should see the app interface. 

create Facebook app

3. Create a Facebook Business Manager system userCopy link to this section

1. Log in to Facebook business manager settings -> Users -> System users -> Create new system user -> select admin System user role. 

create Facebook system user

2. Allow this system user access to an Ad account, FB app, and pixel. 

4. Set up FB offline conversion tag in sGTM.Copy link to this section

1. Download FB offline conversion tag from GitHub -> open sGTM templates -> click new tag -> click three dots in the top right corner -> click import -> select FB offline conversion tag you’ve recently downloaded.

import facebook offline conversion tag

2. Create a new Facebook offline conversion tag -> Select event name -> Add FB access token, Offline Event Set ID, Upload Tag. Add required user and event data. To extract variables from event data, you can use event data variables. 

Facebook offline conversion tag

3. Test the tag triggered correctly in sGTM. Unfortunately, there is no way to test FB offline events in real-time. The best thing you can do is open your offline event set after some time and check that it receives data. 

Similar to FB CAPI, the more user data (match keys) you send to FB, the better attribution you get. 

Tag automatically ads event_time to the request, but you can choose to override this value. 

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

Sep 20, 2021

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.

Feb 11, 2021

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.

Oct 4, 2020

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 Staperight now!