ePrivacy and GPDR Cookie Consent by Cookie Consent Skip to main content

Facebook Conversion API Implementation

Steps to implement Facebook Conversion API

1. First, you need to define which events collected by the Meiro Events SDK (or any other data collection) map to which Facebook events. In this documentation the data collection will be referred to as ME SDK for simplicity.

Learn more:  To know more about Facebook events, refer to this doc about standard events , this doc for a reference of the full list of possible standard events , and this section for custom events.

2. After that, follow this documentation to have the ME SDK properly setup along with existing/new FB Pixel data collection. 

The documentation references implementation using Google Tag Manager, but it is optional, implementing the data collection directly in the website’s source code is also possible.

Remember: The important thing to take note is to set up an event id that can identify each individual event that is collected from both Meiro SDK and FB Pixel for deduplication purposes (eg. the same pageView collected by FB Pixel should have the same event id as the page_view event collected by ME SDK).

3. In step 2, you might have seen that there are references to an event name as well in the documentation, this is important as it is how you will map the events collected from ME SDK to FB Pixel events. 

With it, you can either use a python processor or postgresql connector (depending on how you are doing the data collection) to obtain data from ME SDK and format them for the FB Conversion API loader.

Learn more: Refer to the loader documentation for more details about the FB Conversion API loader.

Remember: Note that you need to have at least one customer information parameter (in the loader these are fields prepended by “user_”) included for each event you are sending to FB Conversion API to identify the customer. The more customer identifiers you have, the better the match rate will be on Facebook’s end.

Learn more: For more details about customer information parameters, refer to this documentation .

Warning: There might be hashing mentioned in the docs for the customer information parameters, but since the loader is using the SDK, you DO NOT have to hash the values before sending them to the loader.

4. Lastly, refer to this documentation to verify that the events have been received properly.

FAQ / Notes

1. Are custom events supported by FB Conversion API?

Yes, however since there is a cap on eight pixel events that you can optimize for, prioritize the pixel events according to the business use case.

Learn more: For more information regarding Facebook’s Aggregated event measurement 

2. What is the event id exactly? How is it generated?

The event id is simply an identifier, this can be any arbitrary string value as long as it is unique to every event being sent to FB as Pixel events and Conversion API events through ME SDK. 

This event id needs to be the same for the same event being tracked by FB Pixel and ME SDK.

This event id can be generated by any method as long as it can be unique, typically this is generated on the frontend using uuid generation.

3. Do I need to hash PII (email/phone numbers) before sending them to FB Conversion API?

If you are using the API directly, yes. However in our implementation we are using the FB Conversion API loader compoment built by Meiro which uses the SDK, which already does the hashing, so you don't have to hash the values.