Skip to main content

Event Properties Reference

This document lists all properties automatically tracked by the Grain Analytics SDK and those that developers need to collect manually.

Legend

  • βœ… Auto-tracked: Automatically collected by the SDK
  • πŸ”§ Developer-collected: Must be manually tracked by developers
  • πŸ”’ Consent-required: Only collected with user consent

Standard Events

page_view

Automatically tracked on every page navigation.

_grain_session_start

Automatically tracked when a new session begins (page load).

_grain_session_end

Automatically tracked when a session ends (page unload/close).

_grain_heartbeat

Automatically tracked at regular intervals to measure engagement.
Tracked when user grants analytics consent.

Template Events

These events are available via SDK helper methods but require manual triggering.

login

Track user authentication.

signup

Track user registration.

purchase

Track completed purchases.

checkout

Track checkout initiation.
Properties same as purchase event
Track search queries.

add_to_cart

Track items added to cart.

remove_from_cart

Track items removed from cart. Properties same as add_to_cart event

Custom Events

You can track any custom event with your own properties:
New to event naming? Check out our Event Naming Convention guide for a systematic approach to naming custom events. It provides a hierarchical structure that makes events clear, consistent, and easy to query.

Automatic Property Enrichment

Important: All custom events (except system events starting with _grain_) are automatically enriched with the following properties: Always included (no consent required):
  • Device Info: device (Mobile/Tablet/Desktop), browser, os
Included when user consent is granted:
  • UTM Parameters: utm_source, utm_medium, utm_campaign, utm_term, utm_content (from the current session)
  • First-Touch Attribution: first_touch_source, first_touch_medium, first_touch_campaign, first_touch_referrer_category
  • Session ID: session_id
This ensures that all events have device context and attribution data for matrix analysis and conversion tracking, even if you don’t explicitly include these properties in your custom events. Example: When you track a signup event:
The actual event sent will include:
When tracking custom events, consider including:
  • Context: page, section, component
  • Action details: action_type, target, value
  • User state: is_authenticated, user_plan, user_role
  • Experiment: experiment_id, variant
  • Performance: duration, load_time

Property Scope

Event-Scoped Properties

Properties that exist on the specific event being tracked. Most properties are event-scoped.

User-Scoped Properties

Properties that exist on any event for a given user. In Matrices, you can query by β€œUser Property (Any Event)” to find users who have logged this property at least once, even if not on the specific event being analyzed. Examples:
  • first_touch_* - Set on session_start, can be queried on any event
  • utm_* - Set on page_view, can be queried on conversion events
  • Custom user properties set via grain.setProperty()

Referrer Categories

The SDK automatically categorizes referrers:
  • organic: Search engines (Google, Bing, Yahoo, etc.)
  • paid: Paid advertising (detected via gclid, fbclid, etc.)
  • social: Social media (Facebook, Twitter, LinkedIn, etc.)
  • email: Email clients (Gmail, Outlook, etc.)
  • referral: Other websites
  • direct: No referrer (direct navigation or bookmark)

Browser Detection

Supported browsers:
  • Chrome
  • Firefox
  • Safari
  • Edge
  • Opera
  • Unknown (for unrecognized browsers)

OS Detection

Supported operating systems:
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
  • Unknown (for unrecognized systems)

Best Practices

  1. Only log relevant properties: Don’t send null/undefined values
  2. Use consistent naming: snake_case for property names
  3. Include context: Add page/section/component for UI events
  4. Track user flow: Use consistent event names across journeys
  5. Test attribution: Verify UTM parameters and referrer tracking
  6. Respect privacy: Only collect necessary data, honor consent

Configuration

Disable Auto-Properties

To disable automatic property collection:

Strip Query Parameters

To remove query params from page URLs:

Property Whitelist

To limit which properties can be tracked:

Need Help?