analytics-react-native icon indicating copy to clipboard operation
analytics-react-native copied to clipboard

De-duplication not working in `FacebookAppEventsPlugin`

Open ebeigarts opened this issue 1 year ago • 1 comments

To avoid duplicate events in FB, FacebookAppEventsPlugin should set event_id as messageId, similar as Segment's Pixel Destination and default conversions api mapping, by using event_id: messageId.

https://github.com/segmentio/analytics-react-native/blob/master/packages/plugins/plugin-facebook-app-events/src/FacebookAppEventsPlugin.ts#L162-L164

Conversions API for App Events - Documentation - Meta for Developers

The deduplication mechanism will be required to remove duplicate event traffic between the Conversions API integration and all other existing integrations you have with app events including SDK, MMPs and App Events API.

For app events, we apply the same deduplication functionality that exists for web events. The logic leverages the field event_id and event_name based deduplication (Conversions API and SDK / App Events API events that carry the same event_id). The event_id parameter is an identifier that can uniquely distinguish between similar events. Inaccurate event IDs may cause your conversion to be wrongly deduplicated, further impacting conversion reporting and campaign performance.

You can refer to the following developer documentation to implement the deduplication setup:

How to set up app events

Example of deduplication setup

Here is an example of how to log a custom event. To do so, pass the name of the event as an in iOS SDK:

AppEvents.shared.logEvent(.achievedLevel, parameters: ["event_id": "123"])

ebeigarts avatar Mar 12 '24 14:03 ebeigarts

Thanks for the report. I'm releasing a fix for this later today.

oscb avatar Mar 18 '24 18:03 oscb

Hi @ebeigarts apologies for any confusion and/or delay here. Is this still an issue? Oscar mentioned he was planning on fixing it but I'm not certain he released it. Please just let me know and we will prioritize it this sprint. Thanks!

alanjcharles avatar Jun 18 '24 14:06 alanjcharles

Addressed in #929

hvardhan-unth avatar Jul 01 '24 10:07 hvardhan-unth