Umbrella icon indicating copy to clipboard operation
Umbrella copied to clipboard

Timing events

Open Oyvindkg opened this issue 8 years ago • 3 comments

It may be interesting to know how long it takes before an event to occurs. Timing is supported by most providers, and the implementation is usually very similar to regular events.

Oyvindkg avatar Jun 21 '17 08:06 Oyvindkg

May I have an example? Thanks!

devxoul avatar Jun 21 '17 09:06 devxoul

For example measuring the time it takes to complete a checkout process.

You may do something like this in Mixpanel:

/* When the checkout process is initiated */
Mixpanel.mainInstance().time(event: Event.purchaseCompleted.name)

/* When the purchase is completed */
Mixpanel.mainInstance().track(event: Event.purchaseCompleted.name)

Flurry:

/* When the checkout process is initiated */
Flurry.logEvent(Event.purchaseCompleted.name, withParameters: someParameters, timed: true);

/* When the purchase is completed */
Flurry.endTimedEvent(Event.purchaseCompleted.name, withParameters: nil)

Oyvindkg avatar Jun 21 '17 09:06 Oyvindkg

Looks interesting. But I wonder how could we abstract those methods. Do you have any idea? :thinking:

devxoul avatar Jun 21 '17 10:06 devxoul