track
The track method records custom events that users perform in your application.
Usage
await client.track(user_id, event_name, properties)
Parameters
| Name | Type | Description |
|---|---|---|
user_id | str | Unique identifier for the user. |
event_name | str | Name of the event being tracked (e.g., "Order Completed"). |
properties | Dict[str, Any] | Dictionary of properties related to the event. |
Example
await client.track("u_001", "Plan Upgraded", {
"old_plan": "basic",
"new_plan": "pro",
"revenue": 29.99
})
Dual-Write Behavior
If send_to_customer_io is enabled, the event and its properties will be mirrored to Customer.io using the track API.