'How do I send event_id with Facebook pixel?

I get an error from Facebook:

Purchase Event Missing Some Deduplication Parameters You're sending

Purchase events through both your pixel and the Conversions API, but they're not being deduplicated properly because not enough of these events are receiving an event_id parameter. Event instances sent without an event_id parameter cannot be deduplicated.

Add an event_id parameter to all Purchase events that you're sending from both your pixel and the Conversions API. To add an event_id parameter to the events you're sending through the Conversions API, you can use the Payload Helper tool on the Facebook for Developers site to validate that your payload is set up correctly. To add an event_id parameter to the events you're sending through your pixel, go into your website's source code and add an event_id parameter to each of your Purchase event instances.

But I am sending event_id in my pixel event for Purchase!



Solution 1:[1]

The correct way to send event_id on the server with the Conversions API is at the same level as event_name and not inside user_data or custom_data.

However with the pixel on the client you need to send it like this as a fourth parameter to fbq.

fbq('track', 'Purchase', {value: 12, currency: 'USD'}, {eventID: 'purchase.123456'});

Note it is called eventID when sent from pixel and not event_id. Despite the error message calling it event_id! At time of writing this was the only page I could find this third parameter described.

You can verify in the events manager tool by clicking 'View Details' for an event and then looking at 'Event Deduplication'. It will confirm the parameter is received from the pixel. It may not show here for several hours, or even until the next day - even if you're seeing events being received in real time.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ErvTheDev