For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Parameter
Type
Description

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.

hackleApp.track(eventKey: "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.

Category
Type
Constraints

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.

let event = Hackle.event(
                    key: "purchase",
                    properties: [
                        "pay_method": "CARD",
                        "discount_amount": 800,
                        "is_discount": true
                    ])

// 빌더 패턴
let event2 = Event.builder("purchase")
    .property("pay_method": "credit")
    .build()

hackleApp.track(event: event)
hackleApp.track(event: event2)

Last updated