Segment.Spec.Track (Peacemaker v3.3.5-rc.7) View Source

Builds a token for interfacing with the custom tracking events on Segment. Each event needs to have a validate_token/2 method defined.

Example Usage:

    Track.build()
    |> Track.set_user_id(Peacemaker.Accounts.find_one(email: "kawika@wealthfit.com"))
    |> Track.set_event("wf-new-trial")
    |> Tracker.send_event()

Link to this section Summary

Link to this section Types

Specs

t() :: %Segment.Spec.Track{
  _email: term(),
  context: Map.t(),
  event: String.t(),
  integrations: Map.t(),
  properties: Map.t(),
  timestamp: String.t(),
  type: String.t(),
  userId: String.t(),
  version: String.t()
}

Link to this section Functions

Link to this function

append_traits(track, payload)

View Source
Link to this function

build(conn, optin_payload)

View Source
Creates a token that will be used to track billable events.
Link to this function

build_default_context(conn, order_payload)

View Source
Link to this function

create_traits(email, conn \\ nil)

View Source
Link to this function

remove_integration(track, atom)

View Source
Link to this function

set_context(track, context)

View Source
Link to this function

set_metric(track, key, value)

View Source
Link to this function

set_properties(track, properties)

View Source
Link to this function

set_user_id(track, arg2)

View Source