Skip to contentSkip to navigationSkip to topbar
Page tools
Looking for more inspiration?Visit the

Analytics for React Native Destination Filters


(information)

Info

Destination filters are in beta and only available to Business Tier customers.

Use Analytics-React-Native to set up destination filters on your mobile device-mode destinations.

(warning)

Warning

You must use Analytics-React-Native version 2.9 or higher to implement destination filters.

Keep these limitations in mind when using destination filters.

To get started with destination filters on mobile device-mode destinations using Analytics-React-Native:

  1. Download and install the @segment/analytics-react-native-plugin-destination-filters package as a dependency in your project.
    • Using npm:
      npm install --save @segment/analytics-react-native-plugin-destination-filters
    • Using yarn:
      yarn add @segment/analytics-react-native-plugin-destination-filters
  2. Follow the instructions for adding plugins on the main Analytics client.
  3. Add DestinationFiltersPlugin after you create your Segment client.
1
import { createClient } from '@segment/analytics-react-native';
2
3
import { DestinationFiltersPlugin } from '@segment/analytics-react-native-plugin-destination-filters';
4
5
const segmentClient = createClient({
6
writeKey: 'SEGMENT_KEY'
7
});
8
9
segmentClient.add({ plugin: new DestinationFiltersPlugin() });
10
segment.add({ plugin: new FirebasePlugin() })