From 94c90d82cb54a0e417f3396ea4daf2e3d7c26a08 Mon Sep 17 00:00:00 2001 From: Niall Brennan Date: Tue, 8 Sep 2020 11:46:48 +0100 Subject: [PATCH 1/3] add setidfa method --- .../catalog/libraries/mobile/react-native/index.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/connections/sources/catalog/libraries/mobile/react-native/index.md b/src/connections/sources/catalog/libraries/mobile/react-native/index.md index f32d1d1400..735901f0d6 100644 --- a/src/connections/sources/catalog/libraries/mobile/react-native/index.md +++ b/src/connections/sources/catalog/libraries/mobile/react-native/index.md @@ -515,11 +515,12 @@ Yep! Our SDK is [open-source](https://github.com/segmentio/analytics-react-nativ ### IDFA -Some destinations, particularly mobile attribution tools (e.g. Kochava), require the IDFA (identifier for advertisers). The IDFA shows up in Segment calls in the debugger under `context.device.advertisingId`. In order for this value to be captured by the Segment SDK, ensure that you include the [iAd framework](https://developer.apple.com/reference/iad). +Some destinations, particularly mobile attribution tools (e.g. Kochava), require the IDFA (identifier for advertisers). The IDFA shows up in Segment calls in the debugger under `context.device.advertisingId`. From our React Native [1.3.0](https://github.com/segmentio/analytics-react-native/blob/master/CHANGELOG.md) release onwards Segment will no longer automatically collect IDFA. Collection of IDFA will be handled externally of Segment and can be set via the following method: -Once you enable this, you will see the `context.device.advertisingId` populate and the `context.device.adTrackingEnabled` flag set to `true`. - -_Note_: While the network is deprecated, the relevant [framework](https://developer.apple.com/reference/iad) is not. +```java +import analytics from '@segment/analytics-react-native'; +analytics.setIDFA("123"); +``` ### Using a custom anonymousID From 30a8b1c12c24a9f3dddbf5de654dafb5a733a355 Mon Sep 17 00:00:00 2001 From: Niall Brennan Date: Wed, 9 Sep 2020 13:46:53 +0100 Subject: [PATCH 2/3] Update src/connections/sources/catalog/libraries/mobile/react-native/index.md Co-authored-by: LRubin --- .../sources/catalog/libraries/mobile/react-native/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/sources/catalog/libraries/mobile/react-native/index.md b/src/connections/sources/catalog/libraries/mobile/react-native/index.md index 735901f0d6..721fcd3fea 100644 --- a/src/connections/sources/catalog/libraries/mobile/react-native/index.md +++ b/src/connections/sources/catalog/libraries/mobile/react-native/index.md @@ -515,7 +515,7 @@ Yep! Our SDK is [open-source](https://github.com/segmentio/analytics-react-nativ ### IDFA -Some destinations, particularly mobile attribution tools (e.g. Kochava), require the IDFA (identifier for advertisers). The IDFA shows up in Segment calls in the debugger under `context.device.advertisingId`. From our React Native [1.3.0](https://github.com/segmentio/analytics-react-native/blob/master/CHANGELOG.md) release onwards Segment will no longer automatically collect IDFA. Collection of IDFA will be handled externally of Segment and can be set via the following method: +Some destinations, especially mobile attribution tools (such as Kochava), require the IDFA (identifier for advertisers). The IDFA appears in Segment calls in the debugger as `context.device.advertisingId`. In the [React Native library version 1.3.0](https://github.com/segmentio/analytics-react-native/blob/master/CHANGELOG.md) and later Segment no longer automatically collects the IDFA. IDFA collection must be done outside of Segment, and can be set using the following method: ```java import analytics from '@segment/analytics-react-native'; From 4a65530dac03df5b578416b714a96be8f685fda6 Mon Sep 17 00:00:00 2001 From: Niall Brennan Date: Wed, 9 Sep 2020 13:59:39 +0100 Subject: [PATCH 3/3] add example --- .../sources/catalog/libraries/mobile/react-native/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/connections/sources/catalog/libraries/mobile/react-native/index.md b/src/connections/sources/catalog/libraries/mobile/react-native/index.md index 721fcd3fea..796e45165f 100644 --- a/src/connections/sources/catalog/libraries/mobile/react-native/index.md +++ b/src/connections/sources/catalog/libraries/mobile/react-native/index.md @@ -522,6 +522,8 @@ import analytics from '@segment/analytics-react-native'; analytics.setIDFA("123"); ``` +To get the IDFA you can use an external package such as [react-native-idfa](https://www.npmjs.com/package/react-native-idfa). + ### Using a custom anonymousID You might want to use a custom `anonymousID` to better integrate with other systems in your deployment. The best way to do this is to override the default using the `options` parameter when you call `analytics.identify`, as in the example below.