cljs-exponent.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 Exponent app. It will work correctly if you create a standalone app.

flush

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

identify

(identify user-id)
Associates the current user with a user ID. Call this after calling Exponent.Segment.initializeIOS() and Exponent.Segment.initializeAndroid() but before other segment calls. See https://segment.com/docs/spec/identify/.

identify-with-traits

(identify-with-traits user-id traits)
Associates the current user with a user ID and some metadata. Call this after calling Exponent.Segment.initializeIOS() and Exponent.Segment.initializeAndroid() but before other segment calls. See https://segment.com/docs/spec/identify/.

Arguments
  writeKey (string) -- User ID for the current user.

  :param object traits
  A map of custom properties.

initialize-android

(initialize-android write-key)
Segment requires separate write keys for iOS and Android. Call this with the write key for your Android source in Segment.

Arguments:
  writeKey (string) -- Write key for Android source.

initialize-ios

(initialize-ios write-key)
Segment requires separate write keys for iOS and Android. Call this with the write key for your iOS source in Segment.

Arguments
  writeKey (string) -- Write key for iOS source.

Segment

track

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

Arguments
  event (string) -- The event name.

trackWithProperties

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

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