Event Tracking
The Hackle SDK provides the ability to send user events to Hackle. By using this feature at every point where user behavior changes, you can obtain meaningful data about user actions, and use that data to analyze user behavior.
track
Pass the Event Key to the track() method to send a user event.
Event name (key)
string
Required
Maximum 128 characters.
Example
Assume you have defined an event key called purchase to collect events when a user clicks the purchase button.
import io.hackle.android.HackleApp
import io.hackle.sdk.common.Event
hackleApp.track("purchase")import io.hackle.android.HackleApp
import io.hackle.sdk.common.Event
hackleApp.track("purchase");Property
The Hackle SDK supports adding properties to Event objects.
Properties must be sent as key-value pairs (Property Key and Property Value).
A maximum of 64 properties can be added to an event object.
Property Key
string
Character limit is 128 characters.
Case-insensitive.
For example, AGE and age are recognized as the same Property Key.
Property Value
boolean, string, number, array
For string type, the character limit is 1024 characters.
String type is case-sensitive.
For example, APPLE and apple are recognized as different Property Values.
For number type, up to 15 integer digits and up to 6 decimal places are supported.
Example
The example below shows three properties being added: pay_method, discount_amount, and is_discount.
Last updated