Skip to main content
A template method is a track call with a fixed event name and a typed property object. Every method is a member of a GrainAnalytics instance. Every property is optional, and every property type extends Record<string, unknown>, so a custom property is allowed next to the listed ones. Read Template events for when to use them. Every method returns Promise<void>. options is a SendEventOptions object. Its one field, flush, sends the event now instead of with the next batch.

trackLogin

trackSignup

trackCheckout

trackPageView

trackPurchase

trackSearch

trackAddToCart

trackRemoveFromCart