Salla.analytics.track method.Salla.analytics.track(eventName, properties)| Parameter | Type | Description |
|---|---|---|
eventName | string | The name of your custom event (e.g., "Promotion Viewed"). |
properties | object | Key-value pairs containing the event payload. |
Salla.onReady() so the analytics module is fully loaded.context object containing environment data (browser, device, page, campaign). You can extend this context with custom properties, such as an A/B test variant or loyalty tier, using one of the following methods.setAppContext to define context properties that will automatically attach to all subsequent events fired by your app or theme. The appId ensures isolation, preventing your context from overwriting data from other apps.context key inside your properties object.setAppContext or Scoped Context for isolated, reliable context management.withAppScope to attach context exclusively within a specific code block. Once the block executes, the context is automatically stripped, preventing data leaks into unrelated events.try/catch blocks to prevent third-party failures from breaking the storefront UI.