If you have implemented the Renta Javascript SDK and switched to collecting first-party data, then you will have a window of opportunities for server-side integrations. And one of them is the Facebook Conversion API.

In this guide, we will discover how to set up data transfer to the Facebook Conversion API using server-side integrations in a matter of minutes.

If you haven’t implemented first-party data collection yet, then use this instruction to implement the Renta Javascript SDK tracker on your website, and then return to this guide.

How does it work?

Before we proceed to the setup, a few important things should be outlined.

Facebook Conversions API scheme

Renta Javascript SDK is a first-party tracking system based on server-side technologies. All events about user actions on the site are sent to a dedicated server architecture for your project, which allows us to easily transform and send incoming data to various destinations, such as the Facebook Conversion API.

Facebook Conversion API is a method of transmitting events to Facebook Pixel using the API. The more data you send to Facebook’s side the more likely Facebook will match them.

The essence of integration is to synchronize incoming Javascript SDK events with the available Facebook CAPI fields. 

And in conclusion, briefly about the data schema.

Renta Javascript SDK output data 

Each Javascript SDK event comes with standard fields such as userAgent, IP, City, or pageUrl. A full list and description of the fields are available in the documentation.

In addition, each event can be supplemented with custom fields (we call them properties). For example, you can specify the email or name of your users.

That is, you can specify a unique set of properties for each individual event, which will later be available for transmission to Facebook CAPI.

Facebook input data

Facebook CAPI expects to receive incoming data according to its documentation. All of them are available for integration via  Renta. Besides, you don’t have to worry about the data format — we automatically convert them to the API requirements.

For example, we cache users’ personal data or convert geodata to ISO format.

As a result, all incoming events that arrive on the server are transported in real-time to the Facebook Conversion API. The more data you transmit, the higher the probability of matching data on the Facebook side.

Implementation of the Conversion API

Here is a step-by-step guide to creating an integration.

Step 1: Specify the data source.

Select the created JavaScript SDK data source in Renta's integration catalog. All events that you track on the website will be available for integration with Facebook CAPI.

Next, you will be redirected to a page where you must specify the destination. In our example, this is the Facebook Conversion API.

Step 2: Specify the destination.

Log in with a Facebook account that has access to the PIxel you plan to transfer data to.

Select the account you added.

Step 3: Configuration settings.

This step is the main one. Its purpose is to specify the mapping fields for data synchronization between the first-party tracking and Facebook Conversion API, which provides full control over the data you share with a third party, which is especially important when observing GDPR.

Facebook CAPI sittings

Let’s go directly to the setup.

Integration name
Specify any name.

It is displayed in the list of created integrations in the Renta interface.

Ad account 
Displays a list of available business manager accounts and advertising cabinets that Facebook Pixel is linked to.

Select the business manager that contains the desired Facebook Pixel.

Facebook Pixel Name
Specify the Facebook Pixels to which you want to transfer events.

Event type
Select the Javascript SDK event from which you want to sync data with the Facebook Conversion API, for example, page.


This means that every time you view a page, the page event will trigger the activation of sending data to Facebook CAPI. The data that comes with the page event is available for transmission to the Facebook Conversion API.

Filters  

Allow you to add additional filtering. For example, you need to send page view events only for the blog section. To do this, you can add a filter: page contains blog.

Facebook Pixel event name
Select a standard event type or specify a custom event name to be sent to Facebook CAPI.

Renta supports the transmission of both standard and custom events. In our example, we send the fact of viewing the blog page. Accordingly, it’s most logical to use the standard View Content event.

Action Source
The action takes place on the site, so we keep the Website.

Data mapping
This is the most responsible step. Here we specify the configuration of how the page event data should be mapped to the fields that we pass to Facebook CAPI.


You can fully control what data will be transmitted to Facebook CAPI. We have prepared a recommended list of parameters for transmission below:

Renta Javascript SDK fields Facebook CAPI fields Data type Hashing required
eventId Event ID String Do not hash
page Event source URL String Do not hash
title Content Name String Do not hash
fbc_cookie_id Click ID String Do not hash
fbp_cookie_id Browser ID String Do not hash
deviceIp Client IP Address String Do not hash
deviceUserAgent Client User Agent String Do not hash
city City String Hashing required
country Country String Hashing required

These parameters are enough to provide a data-matching score in Facebook Ads at the level of 7/10.

We also recommend transferring the email and phone fields for events that contain this information. This will bring the data matching score closer to the maximum values.

Debug mode
Responsible for debugging mode. To test the integration in test mode, copy the test event code from the Facebook Pixel interface and specify it in this field:

This will ensure that the event is passed to the Facebook API test environment. Disable this setting after the testing is complete. Then save the integration.

On this server-side, the Facebook Pixel implementation is complete, but let’s take another example.

Sending transactions to the Facebook Conversion API

Let’s analyze an example of a configuration for sending a transaction with the client’s personal data (in a hash, of course).

We will change only three blocks in this case:

Event type
Select the Javascript SDK event that commits the transaction.

This is a track-type event in my example, where eventName is TransactionCompleted.

Facebook Pixel event name
Purchase is a standard Facebook Pixel event that should be used to commit transactions.

Data mapping
I will add custom fields that come with the data of the selected event to the recommended parameters:

Where: 

Renta Javascript SDK fields Facebook CAPI fields Data type Hashing required
Properties.email Email String Hashing required
Properties.first_name First Name String Hashing required
Properties.last_name Last Name String Hashing required

Thus, you can create secure data flows based on server-side solutions. Renta’s infrastructure automatically converts data to the requirements of the Facebook Conversion API.

Conclusions: 

  1. Against the background of tightening the policy regarding third-party cookies by such systems as Intelligent Tracking Prevention from Apple, the ability of Facebook Pixel to track data is decreasing. The Conversion API allows you to fill these gaps and provide better attribution of conversions.

  2. Using Facebook CAPI increases the size of the user audience for retargeting and building look-a-like audiences.

  3. Flexible data flow configuration settings allow you to respond to the requirements of Schrems II and GDPR.


Quick start

If you are not using first-party tracking yet, learn how to build a modern analytical stack for product and marketing analytics tasks based on the Renta Javascript SDK.

Also do not hesitate to contact the customer success team if you need technical assistance when implementing the Conversion API.