class Mixpanel::Tracker
- Mixpanel::Tracker
- Reference
- Object
Overview
Use Mixpanel::Tracker to track events in your application. To track an event, use
tracker = Mixpanel::Tracker.new "YOUR_TOKEN"
tracker.track "Signup", Mixpanel::Event::Properties{"username" => "Pino", "Age" => 2}
Defined in:
mixpanel/tracker.crConstructors
-
.new(project_token : String, endpoint_track_url : String = ENDPOINT_TRACK)
Create new
Mixpanel::Tracker
with your mixpanel token.
Instance Method Summary
-
#track(name : String, properties : Event::Properties)
The same as
#track
but creates a new event from name andEvent::Properties
. -
#track(event : Event)
Track event on mixpanel.
-
#track(name : String, &block : Event::Properties -> )
Same as
#track
but yieldsEvent::Properties
to the block. -
#track(events : Array(Event))
Sends
Array(Event)
as a batch request to mixpanel. -
#track(*events : Event)
Sends all events as a batch request to mixpanel.
-
#track_url(event : Event, ip : Bool = false, redirect : String | Nil = nil, img : Bool = false, callback : String | Nil = nil, verbose : Bool = false) : URI
Generates tracking
URI
from event and request parameters. -
#track_url(name : String, properties : Event::Properties, ip : Bool = false, redirect : String | Nil = nil, img : Bool = false, callback : String | Nil = nil, verbose : Bool = false) : URI
Same as
#track_url
but creates a new event based on name andEvent::Properties
.
Constructor Detail
Create new Mixpanel::Tracker
with your mixpanel token.
Instance Method Detail
The same as #track
but creates a new event from name and Event::Properties
.
Same as #track
but yields Event::Properties
to the block.
Generates tracking URI
from event and request parameters.
Same as #track_url
but creates a new event based on name and Event::Properties
.