klaviyo logo

Track when someone takes an action or does something on your website.

License
Proprietary
Pricing model
Pay-Per-Use
Protocol
HTTPS
Response format
JSON
Security scheme
JSON Web Tokens
Service
General

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:

token
string
This is your public API key.
event
string
Name of the event you want to track.
customer_properties
hash/dictionary
Custom information about the person who did this event. You must identify the person by their email, using a $email key, or a unique identifier, 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.
properties
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.).
time
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 /api/track.

Updated on Dec 26, 2019
Claim this API or report abuse