You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/sources/catalog/libraries/mobile/react-native/implementation.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -205,6 +205,7 @@ Analytics React Native was built to be as extensible and customizable as possibl
205
205
-[Native AnonymousId](#native-anonymousid)
206
206
-[Configure iOS deep link tracking](#configure-ios-deep-link-tracking)
207
207
-[Device identifiers](#device-identifiers)
208
+
-[Using a WebView Component with React Native](#using-a-webview-component-with-react-native)
208
209
209
210
### Control upload with flush policies
210
211
@@ -467,5 +468,24 @@ On Android, Segment's React Native library generates a unique ID by using the DR
467
468
468
469
To collect the Android Advertising ID provided by Play Services, Segment provides a [plugin](https://github.com/segmentio/analytics-react-native/tree/master/packages/plugins/plugin-advertising-id){:target="_blank"} that can be used to collect that value. This value is set to context.device.advertisingId. For iOS, this [plugin](https://github.com/segmentio/analytics-react-native/tree/master/packages/plugins/plugin-idfa){:target="_blank"} can be used to set the IDFA context.device.advertisingId property.
469
470
471
+
### Using a WebView Component with React Native
472
+
473
+
If you use a webView component in your app that utilizes our [Analytics.js](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/){:target="_blank"} library, you can utilize our [Querystring API](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/querystring/){:target="_blank"} to pass the anonymousId from your React Native app to Analytics.js to ensure activity from anonymous users can be linked across these two sources.
474
+
475
+
To retrieve and pass the anonymousId:
476
+
477
+
1. Retrieve anonymousId from the React Native library using:
2. Pass this value into the querystring that opens the webview using the ```ajs_aid``` optional query string parameter noted in the above linked documentation. For example, your WebView component might look like:
3. When a user clicks the element that opens the webview, AJS will read that parameter and automatically set the anonymousId to whatever value is passed in, linking your events across both libraries to the same user.
489
+
470
490
## Changelog
471
491
[View the Analytics React Native changelog on GitHub](https://github.com/segmentio/analytics-react-native/releases){:target="_blank"}.
0 commit comments