Documentation

Hey friend! We are co-hosting a conference with Software Mansion, learn more.

Segment

Provides access to https://segment.com/ mobile analytics. Wraps Segment's iOS and Android sources.
Note: Session tracking may not work correctly when running Experiences in the main Expo app. It will work correctly if you create a standalone app.

Segment requires separate write keys for iOS and Android. You will need to log in to Segment to recieve these https://segment.com/docs/guides/setup/how-do-i-find-my-write-key/

Accepts an object with the following keys:
  • androidWriteKey (string) -- Write key for Android source.
  • iosWriteKey (string) -- Write key for iOS source.

Associates the current user with a user ID. Call this after calling Expo.Segment.initialize() but before other segment calls. See https://segment.com/docs/spec/identify/.

  • userId (string) -- User ID for the current user.

Associates the current user with a user ID and some metadata. Call this after calling Expo.Segment.initialize() but before other segment calls. See https://segment.com/docs/spec/identify/.

  • userId (string) -- User ID for the current user.
  • traits (object) -- A map of custom properties.

Log an event to Segment. See https://segment.com/docs/spec/track/.

  • event (string) -- The event name.

Log an event to Segment with custom properties. See https://segment.com/docs/spec/track/.

  • event (string) -- The event name.
  • properties (object) -- A map of custom properties.

Record that a user has seen a screen to Segment. See https://segment.com/docs/spec/screen/.

  • screenName (string) -- Name of the screen.

Record that a user has seen a screen to Segment with custom properties. See https://segment.com/docs/spec/screen/.
  • screenName (string) -- Name of the screen.
  • properties (object) -- A map of custom properties.

Manually flush the event queue. You shouldn't need to call this in most cases.