Segment.Analytics (segment v0.2.7) View Source
The Segment.Analytics module is the easiest way to send Segment events and provides convenience methods for track, identify, screen, alias, group, and page calls
The functions will then delegate the call to the configured service implementation which can be changed with:
config :segment, sender_impl: Segment.Analytics.Batcher, By default (if no configuration is given) it will use Segment.Analytics.Batcher to send events in a batch periodically
Link to this section Summary
Functions
alias is how you associate one identity with another with properties defined in the Segment.Analytics.Alias struct
alias is how you associate one identity with another. alias/3 takes a user_id and a previous_id to map from. It also takes an optional Segment.Analytics.Context struct.
The group call is how you associate an individual user with a group with the properties in the defined in the Segment.Analytics.Group struct
The group call is how you associate an individual user with a group. group/4 takes a user_id and a group_id to associate it with. It also takes optional traits of the group and
an optional Segment.Analytics.Context struct.
identify lets you tie a user to their actions and record traits about them as defined in the
Segment.Analytics.Identify struct
identify lets you tie a user to their actions and record traits about them. identify/3 takes a user_id, optional additional traits and an optional Segment.Analytics.Context struct.
The page call lets you record whenever a user sees a page of your website with the properties defined in the Segment.Analytics.Page struct
The page call lets you record whenever a user sees a page of your website. page/4 takes a user_id and an optional page_name, optional properties and an optional Segment.Analytics.Context struct.
screen let you record whenever a user sees a screen of your mobile app with properties defined in the
Segment.Analytics.Screen struct
screen let you record whenever a user sees a screen of your mobile app. screen/4 takes a user_id, an optional screen_name, optional properties and an optional Segment.Analytics.Context struct.
Make a call to Segment with an event. Should be of type Track, Identify, Screen, Alias, Group or Page
track lets you record the actions your users perform. Every action triggers what Segment call an “event”, which can also have associated properties as defined in the
Segment.Analytics.Track struct
track lets you record the actions your users perform. Every action triggers what Segment call an “event”, which can also have associated properties. track/4 takes a user_id, an
event_name, optional additional properties and an optional Segment.Analytics.Context struct.
Link to this section Types
Specs
Link to this section Functions
Specs
alias(Segment.Analytics.Alias.t()) :: :ok
alias is how you associate one identity with another with properties defined in the Segment.Analytics.Alias struct
Specs
alias(segment_id(), segment_id(), Segment.Analytics.Context.t()) :: :ok
alias is how you associate one identity with another. alias/3 takes a user_id and a previous_id to map from. It also takes an optional Segment.Analytics.Context struct.
Specs
call(Segment.segment_event()) :: :ok
Specs
group(Segment.Analytics.Group.t()) :: :ok
The group call is how you associate an individual user with a group with the properties in the defined in the Segment.Analytics.Group struct
Specs
group(segment_id(), segment_id(), map(), Segment.Analytics.Context.t()) :: :ok
The group call is how you associate an individual user with a group. group/4 takes a user_id and a group_id to associate it with. It also takes optional traits of the group and
an optional Segment.Analytics.Context struct.
Specs
identify(Segment.Analytics.Identify.t()) :: :ok
identify lets you tie a user to their actions and record traits about them as defined in the
Segment.Analytics.Identify struct
Specs
identify(segment_id(), map(), Segment.Analytics.Context.t()) :: :ok
identify lets you tie a user to their actions and record traits about them. identify/3 takes a user_id, optional additional traits and an optional Segment.Analytics.Context struct.
Specs
page(Segment.Analytics.Page.t()) :: :ok
The page call lets you record whenever a user sees a page of your website with the properties defined in the Segment.Analytics.Page struct
page(user_id, page_name \\ "", properties \\ %{}, context \\ Context.new())
View SourceSpecs
page(segment_id(), String.t(), map(), Segment.Analytics.Context.t()) :: :ok
The page call lets you record whenever a user sees a page of your website. page/4 takes a user_id and an optional page_name, optional properties and an optional Segment.Analytics.Context struct.
Specs
screen(Segment.Analytics.Screen.t()) :: :ok
screen let you record whenever a user sees a screen of your mobile app with properties defined in the
Segment.Analytics.Screen struct
screen(user_id, screen_name \\ "", properties \\ %{}, context \\ Context.new())
View SourceSpecs
screen(segment_id(), String.t(), map(), Segment.Analytics.Context.t()) :: :ok
screen let you record whenever a user sees a screen of your mobile app. screen/4 takes a user_id, an optional screen_name, optional properties and an optional Segment.Analytics.Context struct.
Specs
send(Segment.segment_event()) :: :ok
Make a call to Segment with an event. Should be of type Track, Identify, Screen, Alias, Group or Page
Specs
track(Segment.Analytics.Track.t()) :: :ok
track lets you record the actions your users perform. Every action triggers what Segment call an “event”, which can also have associated properties as defined in the
Segment.Analytics.Track struct
track(user_id, event_name, properties \\ %{}, context \\ Context.new())
View SourceSpecs
track(segment_id(), String.t(), map(), Segment.Analytics.Context.t()) :: :ok
track lets you record the actions your users perform. Every action triggers what Segment call an “event”, which can also have associated properties. track/4 takes a user_id, an
event_name, optional additional properties and an optional Segment.Analytics.Context struct.