Docly

Facebook

Estimated reading: 3 minutes

The provider Facebook gives you the ability to only make Server Side API calls to the Facebook Conversion API. This can be done at any of the six available event moments. Click here to get more information about the Facebook Conversion API.

To use the Facebook provider in Measurements you must have entered a Pixel ID and an Access token in the CampaignSuite settings. Without these two values ​​it is not possible to use this provider. More information about setting up a Pixel can be found at this page.

The Facebook Conversion API works on the basis of events. CampaignSuite will create a JSON based on the mapping made in the Feed action, which will be sent via a POST request to Facebook’s API. See the example below of the mapping in CampaignSuite and the JSON sent to Facebook.

Example of mapping:

JSON being generated:

{
   "data": [
      {
         "event_name": "Purchase",
         "event_time" "1666081911",
         "event_id": "1_346",
         "event_source_url": "https://www.examplewebsite.nl/doneer",
         "action_source": "site",
         "user_data": {
            "client_ip_address": "1.1.1.1",
            "client_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko)",
            "em": "309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd",
            "fn": "254aa248acb47dd654ca3ea53f48c2c26d641d23d7e2e93a1ec56258df7674c4",
            "ln": "eeacc9d4cf711ce63f7d247062f52ca2fe4be1a1a8aef231fe23e75e7bdca60c",
            "ph": "191d48a770670b9ae8f59dbb16c64c583f92d1922a2a440b26e36bf6e3970bf0"
         },
         "custom_data": {
            "value": 100.2,
            "currency": "EUR",
            "form_id": "1",
            "entry_id": "346"
         }
      }
   ]
}
  • event_id
    The event_id parameter is automatically filled with a combination of the form ID and the entry ID (1_346).
  • action_source
    The parameter action_source will be automatically filled with the value website provided it is not mapped with its own value.
  • event_time
    The parameter event_time is filled by default with the date and time of submission in the form.
  • custom_data.currency
    The parameter < strong>custom_data.currency is filled by default with the event type After a successful payment.

Custom parameters

In addition to the predefined parameters, it is also possible to send parameters yourself. Click here for a list of the available parameters for Facebook.
For example, to add a city field to user_data you must enter as key value: data.user_data.ct. This will then automatically in the JSON.
In the example above, the phone number field custom has been added.