Skip to content

Commit 3543253

Browse files
authored
Merge pull request #1092 from segmentio/niall/update_idfa_react
Document setIDFA method for React Native
2 parents 56e0d4e + dd75cb2 commit 3543253

File tree

1 file changed

+6
-3
lines changed
  • src/connections/sources/catalog/libraries/mobile/react-native

1 file changed

+6
-3
lines changed

src/connections/sources/catalog/libraries/mobile/react-native/index.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,11 +515,14 @@ Yep! Our SDK is [open-source](https://github.com/segmentio/analytics-react-nativ
515515

516516
### IDFA
517517

518-
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).
518+
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:
519519

520-
Once you enable this, you will see the `context.device.advertisingId` populate and the `context.device.adTrackingEnabled` flag set to `true`.
520+
```java
521+
import analytics from '@segment/analytics-react-native';
522+
analytics.setIDFA("123");
523+
```
521524

522-
_Note_: While the network is deprecated, the relevant [framework](https://developer.apple.com/reference/iad) is not.
525+
To get the IDFA you can use an external package such as [react-native-idfa](https://www.npmjs.com/package/react-native-idfa).
523526

524527
### Using a custom anonymousID
525528

0 commit comments

Comments
 (0)