Skip to main content
This page lists the properties that the Grain Analytics SDK collects on its own, and the properties that you collect. The tables come from the Analytics Web SDK reference. Every event has a Collected column with one of three values. The TypeScript types of the published package win over this page when they disagree.

Standard events

page_view

Sent on every page navigation.

_grain_session_start

Sent when a session begins, on page load.

_grain_session_end

Sent when a session ends, on page unload or close.

_grain_heartbeat

Sent at a fixed interval to measure engagement. Read Automatic tracking for the intervals. Sent when the user grants analytics consent.

Template events

The template methods send these events. You call the method and pass the properties. Read Template events.

login

Analytics Web

signup

Analytics Web

purchase

Analytics Web

checkout

Sent by trackCheckout when the checkout starts. The properties are the same as purchase, plus success.
Analytics Web
Analytics Web

add_to_cart

Analytics Web

remove_from_cart

Sent by trackRemoveFromCart. The properties are the same as add_to_cart.

Custom events

A custom event carries the properties that you pass. Read Name events for the naming convention.
Analytics Web
The SDK adds properties to every custom event. System events that start with _grain_ are the exception. As a result, every event has device context and attribution data for matrices and conversion tracking. A call of grain.track('signup', { plan: 'pro' }) sends:
Properties that a custom event often needs:

Property scope

An event-scoped property exists on the event that carries it. Most properties are event-scoped. A user-scoped property exists on any event of the user. In a matrix, the filter “User Property (Any Event)” finds users who logged the property at least one time, on any event. These properties are user-scoped: Read User properties.

Referrer categories

Browser and OS values

Configuration

Three options of GrainConfig change what the SDK collects.
Analytics Web

Rules for properties

  1. Do not send null or undefined values. Leave the property out.
  2. Use snake_case for property names.
  3. Add page, section, and component to UI events.
  4. Use the same event names across a user journey, so that a track can join them.
  5. Test attribution with a URL that holds UTM parameters and a referrer.
  6. Collect only the data that a report needs, and obey consent.