Segment.io

The Analytics API You've Always Wanted.



Zachary Flower

@zachflower





                          How developers do


                                                      today...

ANALYTICS

Look Familiar?




                             Introducing


                                     of analytics tracking!

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





userIdString, optional

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 userId and just record traits.

traitsObject, optional

A dictionary of traits you know about the user. Things like: email,namesubscriptionPlan, etc.

optionsObject, optional

A dictionary of extra options for the call.

callbackFunction, optional

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




eventString

The name of the event you're tracking. We recommend using human-readable names like 'Played a Song' or 'Updated Status'.

propertiesObject, optional

A dictionary of properties for the event. If the event was 'Added to Shopping Cart', it might have properties like price,productType, etc.

optionsObject, optional

A dictionary of extra options for the call.

callbackFunction, optional

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!

Made with Slides.com