Track specific user actions and business events with HumanBehavior SDK
customEvent
function to track any user action with relevant context:
Property/Option | Type | Description |
---|---|---|
eventName | string | Descriptive name for the custom event (e.g., ‘purchase_completed’). |
properties | object | Event data with any key-value pairs (strings, numbers, booleans, arrays, objects). |
customEvent() | function | Track a custom event with name and properties. |
automaticTracking | boolean | Button, link, and form events are tracked automatically (enabled by default). |
customEvent(eventName, properties)
parameters:
Parameter | Type | Description |
---|---|---|
eventName | string | Name of the event (required). |
properties | object | Event data (optional but recommended). |
properties
fields:
Field | Type | Description |
---|---|---|
orderId | string | Order, transaction, or reference ID. |
total | number | Purchase total, price, or value. |
currency | string | Currency code (e.g., ‘USD’, ‘EUR’). |
category | string | Product category or event type. |
userId | string | Associated user ID (if different from session). |
feature | string | Feature or tool name. |
duration | number | Time spent or duration in milliseconds. |