This page deals with the manual integration and covers:
This section is only applicable if you decide to complete this integration using a manual integration and developer resources. If you instead decide to complete this integration using a partner, follow the respective partner instructions for the integration. You can skip to 4: Verify your data section of this guide once the partner integration is complete.
You will need Business Manager admin access to complete these integration steps. You may acquire access from the email sent to you if you were invited as a developer. Otherwise, contact a Business Manager admin to request access.
This step will lay out the payload specifications for the Conversions API for CRM integration and provide some recommendations on how to send it from your server.
Name | Description |
---|---|
string
| Free-form field to capture the lead stages you use within your CRM. The |
integer
| A Unix timestamp in seconds indicating when the lead stage update event is updated by your CRM. |
string
| Value: (By using the Conversions API, you agree that the |
object
| A map that contains customer information data. See Customer Information Parameters for options. See Advanced Matching for comparable options available for data sent via Meta Pixel. |
string
| The name of the CRM where the events are coming from. |
string
| Value: |
lead_id
, please use a valid lead_id
or else the system will reject the event. If you choose to send email, phone number, these have to be hashed. Click ID currently does not have API rejection level error, but a large volume of invalid click_id
will cause an alert in the system.Parameter | Priority | Description |
---|---|---|
Lead ID (recommended) How to find the lead ID? | Highest | The Facebook generated ID for every lead. It is a 15 or 16-digit number obtained from the Refer to Find the Lead ID for more information. |
Click ID | Highest | |
Hashed email | Highest | |
Hashed phone number | High | |
Other hashed Contact Information | Medium |
Note:In addition to a hashed email and phone number, you can send hashed gender, date of birth, last name, first name, city, state, zip and more to Meta.
{ "data": [ { "event_name": "initial_lead", "event_time": 1629424350, "action_source": "system_generated", "user_data": { "lead_id": 525645896321548 }, "custom_data": { "event_source": "crm", "lead_event_source": "salesforce" } } ] }
lead_id
or else the system will reject your event. lead_id
, please use valid lead_id
or else the system will reject the event. If you choose to send email, phone number, these have to be hashed. Click ID currently does not have API rejection level error, but a large volume of invalid click_id
will cause an alert in the system.Once you configure what you will send, the next step is to configure where you will send the data.
This step will help you generate an access token for your Meta Pixel, which will then be used to establish a connection between your server and the Conversions API.
POST
request to the Conversions API without the SDK. You can get the entire endpoint by clicking Copy endpoint in the CRM Integration guide and saving it.
https://graph.facebook.com/API_VERSION/PIXEL_ID/events?access_token=ACCESS_TOKEN
API_VERSION
: The current Marketing API versionPIXEL_ID
: The Pixel ID can be obtained from Events Manager for each PixelACCESS_TOKEN
: The access token generated aboveAt this point you may want to send a test payload to your Pixel before implementing the code on your server. You can do so by using the Test Events tab in Events Manager.
test_event_code
value, which can change over time.POST
mode.test_event_code
parameter from the previous step and a valid lead_id
.fbtrace_id
.The production data should be in the same format as the payload generated in Step 3, except the data will be coming directly from your server. This step will vary for every integration so this section will provide guidelines rather than a walkthrough.
lead_id
(recommended) and additional customer information parameters that are listed above for matching.lead_id
event_name
event_time
{ "event_name": "initial_lead", "event_time": 1628294742, "user_data": { "lead_id": 1234567890123456 }, "action_source": "system_generated", "custom_data:" { "lead_event_source": "Salesforce", "event_source": "crm" } }A payload that passes in values from your database using variables may look like this:
{ "event_name": lead_stage // "initial_lead" "event_time": unix_time // 1628294742 "user_data": { "lead_id": fb_lead_id // 1234567890123456 }, "action_source": "system_generated", "custom_data:" { "lead_event_source": "Salesforce", "event_source": "crm" } }
event_time
and upload_time
. Backfilling some data may speed up the training process.
WARNING: Do not attempt to backfill more than 7 days of data by modifying the event_time
values. The model relies on an accurate time stamp to optimize. Doing so may cause all your backfilled data to be discarded.
event_time
values are after the lead generation timestamp, otherwise your events may be discarded.lead_id
in your payloads for events to appear. Open each event sent for the Conversion Leads CRM integration in Events Manager and check that they have the custom parameters lead_event_source
and event_source
populated. If the event does not have these parameters, it will not get registered as a Conversion Leads event.