React Native: Segment

Setup

  1. Sign uparrow-up-right for Segment.io and create a Segment.io project for your mobile application.

  2. Add React Native Segmentarrow-up-right by following the guide.

  3. Install the target:

     npm install --save @redux-beacon/react-native-segment

Usage

import Segment from '@redux-beacon/react-native-segment';
import SegmentAnalytics from '@segment/analytics-react-native';

// Create or import an events map.
// See "getting started" pages for instructions.

SegmentAnalytics.setup(writeKey, options);
const Analytics = SegmentAnalytics;

const segment = Segment();
const segmentMiddleware = createMiddleware(eventsMap, segment);

Event Definitions

Don't see your event listed? Please submit a pull request to the Redux Beacon repositoryarrow-up-right with the missing event. Use the source of the existing event-helpers to guide your work. If you need any support feel free to make the pull request with all you're able to do. We can fill in the gaps from there.

pageView

Docs:

https://segment.com/docs/sources/mobile/react-native/#screenarrow-up-right

event

Docs:

https://segment.com/docs/sources/mobile/react-native/#trackarrow-up-right

alias

Docs:

https://segment.com/docs/sources/mobile/react-native/#aliasarrow-up-right

group

Docs:

https://segment.com/docs/sources/mobile/react-native/#grouparrow-up-right

identify

Docs:

https://segment.com/docs/sources/mobile/react-native/#identifyarrow-up-right

reset

Docs:

https://segment.com/docs/sources/mobile/react-native/#resetarrow-up-right

Last updated