segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
354 stars 181 forks source link

De-duplication not working in `FacebookAppEventsPlugin` #927

Open ebeigarts opened 3 months ago

ebeigarts commented 3 months ago

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"])
oscb commented 3 months ago

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

alanjcharles commented 1 week ago

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!