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
366 stars 188 forks source link

Log more attribution params from AF #642

Closed pepf closed 3 months ago

pepf commented 2 years ago

Summary

The current plugin cherry picks some fields from the Appsflyer payload to forward to Analytics.track(): https://github.com/segmentio/analytics-react-native/blob/b5074f7ac6a4c51cd4e24ee7ff0d2027118e452d/packages/plugins/plugin-appsflyer/src/AppsflyerPlugin.tsx#L79-L85

The docs however indicate the payload can contain a lot more data, depending on various factors. https://support.appsflyer.com/hc/en-us/articles/360000726098-Conversion-data-payloads-and-scenarios#deferred-deep-linking-with-srns

I understand this is where the Analytics.js "spec" for this event comes in, but would love to see a normalized way of retrieving some of the more granular data fields on the Appsflyer payload and forward them to Segment as event. A few fields I am specifically interested in:

Proposed Solution

Looking at the docs I see the meaning of these fields varies per partner (google,facebook etc..) so if this is too scary to implement on your end, maybe exposing a "mapper function" so we can fill in the blank properties on our end would be great :)

hvardhan-unth commented 3 months ago

Addressed in #955