Event Tracking
The Hackle SDK provides the ability to send user events to Hackle. By using this feature at every point where a user action occurs, you can collect meaningful data about user behavior and use it for user behavior analysis.
track
You can send user events by passing the Event Key to the track() method.
Event name (key)
string
Required
Character limit is 128 characters.
Example
Assume an event key called purchase is defined to collect an event when the user clicks the "Buy" button.
import { useTrack } from '@hackle/react-sdk';
function PurchaseButton() {
const track = useTrack();
const handleClick = () => {
track({ key: "purchase" });
};
return <button onClick={handleClick}>구매하기</button>;
}Property
The Hackle SDK supports adding properties to Event objects.
Properties must be sent as key-value pairs (Property Key and Property Value).
The maximum number of properties that can be added to an event object is 64.
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
In the example below, three properties (pay_method, discount_amount, is_discount) are added.
Last updated