Skip to main content
A custom event name has three parts: a category, an object, and an action, joined with underscores. user_signup_clicked is a user event, about the signup, that was clicked. The form makes events sort by domain in the dashboard and easy to filter in a query.
Template events and system events do not follow the convention. Read the sections below before you rename one.

Categories

The category is the domain of the event. Pick the most specific one that fits. If no category fits, extend the closest one with a specific object: user_referral_link_copied, cart_wishlist_moved. For a one-off case, a plain descriptive name is acceptable: easter_egg_discovered.

Actions

The action is a verb in the past tense.

Examples

A checkout flow, with context in properties and not in the name.
Three patterns that come up on most sites:

Template events and system events

Template events are the events behind trackLogin, trackSignup, trackPurchase, trackCheckout, trackSearch, trackAddToCart, and trackRemoveFromCart. Their names are login, signup, purchase, checkout, search, add_to_cart, and remove_from_cart. Do not rename them. The dashboard reads them by these names. Read Template events. System events start with _grain_. The SDK sends them on its own: _grain_session_start, _grain_session_end, _grain_heartbeat, _grain_consent_granted.
Do not create an event name that starts with _grain_. The prefix is reserved for the SDK.

Names in queries

GET /events/{tenantAlias} on the Query API returns every event name in your tenant, sorted. With the convention, the list groups by category on its own: every cart_ event, then every checkout_ event, then every user_ event. A funnel is a list of names in order, for example product_details_viewed, cart_item_added, cart_checkout_started, checkout_completed. Read Export and query data.

Limits

When a name is too long, shorten the object: checkout_address_autocomplete_selected instead of checkout_shipping_address_autocomplete_selected.

Migrate existing names

The SDK accepts any event name, so old names keep working. Migrate at the pace that fits your codebase.

Checklist

Before you track a new custom event, make sure that:
  1. The name has the form {category}_{object}_{action}.
  2. The category is in the table above, or extends one.
  3. The action is a standard verb in the past tense.
  4. The name is 50 characters or fewer.
  5. The name is not a template event name and does not start with _grain_.
  6. The name holds no ID, timestamp, or other data. Data goes in properties.
  7. The name uses the same style as every other event in the application.
  8. A colleague can understand the name without context.