Are you looking for advice on how to take Custobar’s Meta Conversions API integration into use? Would you like to send online and offline sales data (or either) to Meta and create the most effective Meta ads campaigns on Facebook and Instagram? This guide will take you there!
The Meta Conversions API (CAPI) allows you to track conversions server-side in addition to the browser, implementing a more robust tracking, as Meta recommends.
When combined with Custobar, you can add online and/or offline sales conversions to the touchpoints Meta can use, keeping your costs low and your audiences accurate.
[Highlight on the new website] Meta Conversions API integration is a Custobar add-on. Contact support@custobar.com or your Custobar contact person for a quote and to activate the feature.
First, you must send the necessary online and offline sales data to Custobar. Next, you will collect some information within Meta. Finally, you can activate the Meta CAPI integration in Custobar, immediately sending information about your sales into Meta.
To send your online sales data into Meta Conversions API, your sales data must include certain fields which become obligatory in addition to the normal obligatory fields. Also, the sale_date in each sale needs to be at most 7 days old.
The additional obligatory fields are described below, you can always bring these data points to Custobar when you send sales data to Custobar sales API or when importing sales directly via the UI:
Field | Type | Description |
---|---|---|
sale_shop_id | string | “external_id” of a shop where the purchase was made. Data will not be sent to Meta without the sale_shop_id. Data will also not be sent if the associated shop does not have a defined "shop_type" or if the "shop_type" defined is not one of "online" or "offline". |
sale_conversion_user_agent | string | The user agent for the browser corresponding to the event. Example: “Mozilla/5.0 (Windows NT 10.0; Win64; x64)”. |
sale_conversion_url | string | The browser URL where the event happened. The URL must begin with “http://” or “https://” and should match the verified domain. |
If you are unable to send one or more of the above fields directly with your sales data imports, you may send an event with the missing data. The event must have the type of "ONLINE_SALE", the "sale_id" equal to the "sale_external_id" field in your imported sale, the "customer_id" equal to the "external_id" (the id of the customer) in your imported sale, and all of the above fields which you did not include in the original sale import with the following correspondence: "sale_conversion_user_agent" shall be sent as "user_agent" in the event data; "sale_conversion_url" shall be sent as "url" in the event data. Currently sending "sale_shop_id" as part of the "ONLINE_SALE" event is not supported, it must be sent with the sale import.
For convenience, if you use Custobar.js to send your events directly from the browser of your customers, you do not need to send "user_agent" with the event, as the request itself contains the user agent of your customer's browser and Custobar will always use that instead.
Example of importing events manually:
[ { "type": "ONLINE_SALE", "customer_id": "3xb07t", "sale_id": "76242", "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)", "url": "https://myexampleshop.com/product/123" }, … ]
Example of sending events with Custobar.js:
window.cstbr.push({ "type": "ONLINE_SALE", "customer_id": "3xb07t", "sale_id": "76242", "url": "https://myexampleshop.com/product/123" })
Note that “customer_id” must be the same as the “external_id” sent in the sale and “sale_id” must be the same as the “sale_external_id” sent in the sale. Additionally note that “url” must start with “https://” or “http://” and should match the verified domain.
Read more about the Custobar.js tracking script
To send your offline sales data (or, in other words, sales data from your physical stores) into Meta Conversions API, your sales data must include the field “sale_shop_id” in addition to the usual obligatory fields. Also, the sale_date in each sale needs to be at most 7 days old.
Field | Type | Description |
---|---|---|
sale_shop_id | string | “external_id” of a shop where the purchase was made. Data will not be sent to Meta without the sale_shop_id. Data will also not be sent if the associated shop does not have a defined "shop_type" or if the "shop_type" defined is not one of "online" or "offline". |
Before you can activate the Meta CAPI integration in Custobar, you need to generate a Meta CAPI token, copy it, and also copy your Meta pixel ID.
The Meta CAPI integration will send data from Custobar to Meta immediately after its activation as new sales come in. You need admin-level user rights to activate the Meta CAPI or any other integration in Custobar.
If you are using the Meta Pixel in addition to our Conversions API Integration you need to take steps to deduplicate events. Here are 2 relevant sources of information:
It is important to note that you may need to change the way you send data using your Meta Pixel. Deduplication can happen by Meta matching the Pixel's "event" and "eventID" with the integration sent sale’s "event_name" and "event_id", to use this way simply set the Pixel's "event" to "Purchase" and the Pixel’s “eventID” to the same “sale_external_id” sent with your sale to us. Deduplication can also happen by Meta matching the Pixel’s “event” and “external_ID” with the integration sent sale’s “event_name” and the customer “external_id”, to use this way simply set the Pixel's "event" to "Purchase" and the Pixel’s “external_ID” to the same customer’s “external_id” sent with your sale to us. You may find that Meta is also capable of deduplicating events based on the “fbp” browser cookie, however we do not send this with our integration so you are unable to use this method.
To make this change, remove the active Meta CAPI integration and reinstall it following the instructions above. An improvement is on its way to enable editing the settings of an active integration.