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.
_grain_consent_granted
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
search
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
_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:
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 ofGrainConfig change what the SDK collects.
Analytics Web
Rules for properties
- Do not send
nullorundefinedvalues. Leave the property out. - Use
snake_casefor property names. - Add
page,section, andcomponentto UI events. - Use the same event names across a user journey, so that a track can join them.
- Test attribution with a URL that holds UTM parameters and a referrer.
- Collect only the data that a report needs, and obey consent.