Spec: Track
Get started with the custom Track event.
The Track API call is how you record any custom actions your users are doing, along with any properties that describe the action.
Track events can capture a broad range of actions, such as clicking a button or completing a purchase.
Additional information about the event can be included in the properties field. For example, for a Purchase Complete event, you may want to include the product ids of the purchased products.
Naming events
When naming events, Formo recommends establishing a consistent naming convention that uses:
- Consistent formatting: Event names are case sensitive.
- A consistent syntax: Adopt nouns and past tense verbs like Swap Reviewed and Order Submitted. A standard of
[Noun] + [Past-Tense Verb]
ensures all your events are consistent. - A consistent actor: Does ‘Message Sent’ mean that the user sent a message or that you sent a message to the user? If all your events are named in a way that reflects the user’s perspective, the meaning is clear immediately.
This allows everyone including you 6 months from now to instantly understand the meaning of an event.
Fields
Apart from the common fields, the track
call accepts the following fields:
Field | Type | Required | Description |
---|---|---|---|
event | String | ✓ | Name of the user action |
properties | Object | Includes the properties associated with the event. For more information, check the Properties section below. |
Properties
Properties are additional information that give more clarity of your users’ actions.
Formo has reserved some standard properties listed in the following table and handles them in a special manner.
Property | Type | Description |
---|---|---|
revenue | Number | The revenue amount as a result of an event. For e.g., a transaction worth $20.00 would result in a revenue of 20.00. |
currency | String | The currency of the revenue as a result of the event, set in ISO 4127 format. If this is not set, Formo assumes the revenue is in USD. |
points | String | An abstract value such as points or XP associated with an event, to be used by various teams. |
The above properties are used in the dashboards for calculate total revenue and points.