Salla Docs
Merchant
Merchant
  • Merchant API
  • Salla OAuth 2.0
  • Merchant Dashboard
Partner APIs
Partner APIs
  • App API
  • Shipments & Fulfillment APIs
  • Salla AWB
  • Recurring Payments API
  • App Functions
  • Billing System Salla partners
  • Report Builder
  • App Onboarding
  • Communication Apps
Storefront
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Ecommerce Events
  • Component Bundle
  • Change Log
Salla CLI
Merchant
Merchant
  • Merchant API
  • Salla OAuth 2.0
  • Merchant Dashboard
Partner APIs
Partner APIs
  • App API
  • Shipments & Fulfillment APIs
  • Salla AWB
  • Recurring Payments API
  • App Functions
  • Billing System Salla partners
  • Report Builder
  • App Onboarding
  • Communication Apps
Storefront
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Ecommerce Events
  • Component Bundle
  • Change Log
Salla CLI
Salla - Opensource
Salla - Developers Community
  1. Ecommerce Events
  • Overview
  • Getting Started
  • Device Mode
  • Cloud Mode
  • Custom Events
  • Events
    • Account Events
    • Cart & Checkout Events
    • Product Events
    • Promotion & Coupon Events
    • Wishlist Events
  1. Ecommerce Events

Overview

E-commerce events allow you to track and respond to customer actions throughout their shopping journey—from browsing products to completing a purchase. By capturing these events, developers can build applications that react to real user behavior, personalize shopping experiences, optimize marketing workflows, and automate backend processes.
This guide introduces how the event system works and the different ways you can integrate with it.
Our E-commerce event system supports two integration modes:
Device Mode
Cloud Mode via App Functions
Each mode provides a different way to receive and process events depending on your application architecture.

Integration Modes#

Device Mode#

In Device Mode, events are sent directly from the customer’s device—such as a web browser or mobile app—to your callback endpoint.
This integration typically uses a tracker.js script embedded in the storefront frontend. The script captures user interactions in real time and forwards them to your application for processing.
Device Mode is ideal for:
Real-time client-side tracking
Analytics and behavioral insights
Personalization features
Marketing and attribution tools
For implementation details, see Usage – Device Mode.

Cloud Mode (App Functions)#

In Cloud Mode, events are delivered directly from our servers to your backend using App Functions.
This server-to-server approach removes the need for client-side scripts and ensures events are delivered reliably and securely. It is particularly well suited for backend workflows and integrations.
Common use cases include:
Order processing and fulfillment
Data synchronization
Backend automation
Advanced analytics pipelines
To get started, see Usage – Cloud Mode.

Event Lifecycle#

The lifecycle of an e-commerce event depends on the integration mode you choose. While both modes capture the same customer interactions, the path the event takes—from the user action to your application—differs.
Below is a high-level overview of how events flow through the system in each mode.

Device Mode Lifecycle#

In Device Mode, events are captured directly on the client side and forwarded to your tracking script. This allows real-time processing of user interactions within the browser or mobile application.
A typical flow works as follows:
1.
A user performs an action in the storefront (for example, adding a product to the cart).
2.
The browser triggers the event through the Twilight SDK.
3.
The SDK emits the event to the tracker.js script embedded in the storefront.
4.
Your script listens for the event and processes it according to your application logic (analytics, tracking, personalization, etc.).
5.
Optionally, the script can acknowledge the event.

Cloud Mode Lifecycle#

In Cloud Mode, events are handled entirely on the server side. Instead of sending events to a client-side script, the platform forwards them directly to your backend via App Functions.
This model is ideal for backend workflows where reliability, security, and server-side processing are required.
The typical flow is:
1.
A user performs an action in the storefront.
2.
The client sends the event to Salla’s servers.
3.
The platform forwards the event payload to your configured App Function.
4.
Your function executes custom logic such as automation, integrations, or data processing.
5.
Optionally, your function returns a response to the platform.

Quick Summary#

ModeProcessing LocationBest For
Device ModeClient-side (tracker.js)Analytics, personalization, marketing tracking
Cloud ModeServer-side (App Functions)Automation, integrations, backend workflows
Modified at 2026-03-09 07:38:23
Next
Getting Started