The main Events API endpoint is
/api/track, which is used to track when someone takes an action or does something. It encodes the following data in a dictionary or hash:
- This is your public API key.
- Name of the event you want to track.
- Custom information about the person who did this event. You must identify the person by their email, using a
$id. Other than that, you can include any data you want and it can then be used to create segments of people. For example, if you wanted to create a list of people on trial plans, include a person’s plan type in this hash so you can use that information later.
- optional, hash/dictionary or null
- Custom information about this event. Any properties included here can be used for creating segments later For example, if you track an event called “Posted Item,” you could include a property for item type (e.g. image, article, etc.).
- optional, UNIX timestamp or null
- When this event occurred. By default, Klaviyo assumes events happen when a request is made. If you’d like to track and event that happened in past, use this property.
If you only want to track the first occurrance of an event and ignore subsequent events, you can use
/api/track-once. It uses the same request format as