Segment.io
The Analytics API You've Always Wanted.
Zachary Flower
ANALYTICS
Look Familiar?
The Future
Remember THis?
How Does This Look?
ONE API to rule them all...
Seriously...
54 APIs
everything you need to know
Identify & Track
Identifying Users
|
The ID you refer to the user by in your database. If you don't know who the user is yet, you can omit the |
|
A dictionary of traits you know about the user. Things like: |
|
A dictionary of extra options for the call. |
|
A callback function that gets called after a short timeout, giving the browser time to make the identify requests first. |
analytics.identify('019mr8mf4r', {
email : 'achilles@segment.io',
name : 'Achilles',
subscriptionPlan : 'Premium',
friendCount : 29
});
Tracking Events
|
The name of the event you're tracking. We recommend using human-readable names like |
|
A dictionary of properties for the event. If the event was |
|
A dictionary of extra options for the call. |
|
A callback function that gets called after a short timeout, giving the browser time to make the track requests first. Also checkout thetrackLink and trackForm helpers. |
analytics.track('Purchased an Item', {
revenue : 39.95,
shippingMethod : '2-day'
});
What if I Want...
kissmetrics only?
Provide Context
Identify with Context
var context = {
providers: {
'All' : false,
'KISSmetrics' : true
}
};
analytics.identify('019mr8mf4r', {
email : 'achilles@segment.io',
name : 'Achilles',
subscriptionPlan : 'Premium',
friendCount : 29
}, context);
Track with Context
var context = {
providers: {
'All' : false,
'KISSMetrics' : true
}
};
analytics.track('Purchased an Item', {
revenue : 39.95,
shippingMethod : '2-day'
}, context);
no js?
Thank you!
Segment.io
By Zachary Flower
Segment.io
- 723