Overview

Learn about the key concepts and available event types.

When you track an event, you send a payload of properties that describe the event. Throughout the documentation, we classify these properties into two categories:

  • Input properties
    Data that you explicitly provide to the SDK when you track an event.

  • Processed properties
    Data that the SDK automatically collects or derives from the input properties.

An event is essentially an enriched payload. It combines the original data with additional context, such as timestamp, user information, session details, and channel-specific data (e.g., the URL of a web page). These added details are known as context.

Structure

Events share a common structure that includes metadata, context, and payload. While the metadata properties are common to all events, the context and payload properties vary based on the channel and event type, as described in the following section.

Properties

These are the properties common to all events:

sessionId
string

A unique identifier for the session in UUID format.

This ID is assigned to the session based on the session expiration policy defined in the application.

userId
string

A unique identifier for the user in UUID format.

This ID is consistent across sessions based on the anonymity policy defined in the application. It is not the same ID as the one you specify when identifying a user.

timestamp
number

The timestamp of the event in milliseconds since the Unix epoch.

context
EventContext

Additional information about the context in which the event occurred.

type
string

The type of the context.

Currently, only the web context type is supported. As we expand to other channels, new context types like mobile or external will be added.

tabId
string

A unique identifier for the tab in UUID format.

This ID is consistent across page loads and refreshes.

url
string

The URL of the page in which the event occurred.

metadata
Record<string,string>

Additional metadata you can provide to enrich the context.

For example, the application name, screen resolution, or any other relevant information.

payload

The details of the event, which vary depending on the event type.

type
string

The type of the event, such as userSignedUp, productViewed, or linkOpened.

Examples

Below are examples of enriched events:

1234567891011121314
{
"sessionId": "343dd18a-1ab1-4298-8b19-f14880ba4e9c",
"userId": "91d286ab-654a-47a3-ae3f-a0c0d661e44d",
"timestamp": 1440990000,
"context": {
"type": "web",
"tabId": "0b032685-0a7e-4cdd-9ff1-9d3af33507a4",
"url": "https://www.example.com",
},
"payload": {
"type": "linkOpened",
"link": "https://croct.com",
}
}

Event types

The following sections provide a quick reference to the different types of events available, grouped by category.

Account events

Below are all events related to user accounts:

EventAuto trackedDescription
Signed upNoTracks when a user creates an account.
Signed inYesTracks when a user logs into their account.
Signed outYesTracks when a user logs out of their account.
User profile changedNoTracks any changes related to a user's account.

Session events

Below are all events related to user sessions:

EventAuto trackedDescription
Nothing changedYesTracks periods of user inactivity.
Session attributes changedYesTracks changes to session attributes.

Web browsing events

Below are all events related to web interactions and browsing:

EventAuto trackedDescription
Tab openedYesTracks when the user opens a new tab.
Tab URL changedYesTracks when the user navigates to another page.
Tab visibility changedYesTracks when the user switches between tabs.
Page openedYesTracks when the user opens a new page.
Page loadedYesTracks when a webpage finishes loading.

E-commerce events

Below are all events related to e-commerce and shopping:

EventAuto trackedDescription
Product viewedNoTracks when a user views a product.
Cart viewedNoTracks when a user views their shopping cart.
Cart modifiedNoTracks when a user modifies their shopping cart.
Checkout startedNoTracks when a user starts the checkout process.
Order placedNoTracks when a user places an order.

Engagement events

Below are all events related to user engagement:

EventAuto trackedDescription
Post viewedNoTracks when a user views a blog post.
Interest shownNoTracks topics a user may be interested in.
Link openedNoTracks when a user opens a link.
Goal completedNoTracks the completion of a goal.