SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Fix Facebook Pixel and CAPI Duplicate Events

Issue

Customers using Segment’s Facebook Pixel and Facebook Conversions API (CAPI) destinations may see duplicate Purchase events in Facebook reporting. This happens when the Event ID does not match between the Pixel and CAPI events, causing Facebook’s deduplication to fail.

 

Product

Twilio Segment

 

Environment

Segment Console

 

Cause

Facebook deduplication requires both the event name and Event ID to be identical between Pixel and CAPI events. By default, Segment’s Facebook Pixel destination uses the Segment messageId as the Event ID, while the CAPI destination may use a different value (such as orderId or another transaction identifier). If these values do not match, Facebook will count both events separately, resulting in duplicate Purchase events.

 

Resolution

To prevent duplicate Purchase events in Facebook:

  1. Map the Event ID in both destinations to the same value:
    • By default, the Pixel destination uses the Segment messageId as the Event ID.
    • Update the Event ID mapping in your server-side CAPI destination to use the same messageId generated by the client-side event.
  2. Test your setup to confirm that Facebook is deduplicating events and not double-counting.

 

Additional Information 

If you cannot ensure matching Event IDs between Pixel and CAPI events, Facebook may continue to count duplicate events for the same transaction. For more details, refer to Handling Duplicate Pixel and Conversions API Events
 

Have more questions? Submit a request
Powered by Zendesk