Skip to content

track

track(context, eventType, eventData?): Promise<void>

Defined in: analytics.ts:190

POST an event. Fire-and-forget: telemetry never blocks or breaks a render.

Keys the server reads from eventData: variantId, surfaceId, productId, generatedContentId, context (any JSON object), and for a conversion, amount (a number), currency (an ISO 4217 code) and checkoutToken. The server stores currency and checkoutToken only when the conversion also has an amount. variantId defaults to the value in the first argument, and surfaceId does too when that value is a UUID. The SDK sets sessionId. source is kept only for values reserved for SparkleTree’s Shopify extensions. Other top-level keys are not stored; put your own detail under eventData.context.

AnalyticsContext

EventType

Record<string, unknown> = {}

Promise<void>