Retail Engine, 2026

Web events and sessions


Web events and sessions are used in Smart Communications to process customer actions on an online store website or in a mobile app.

Web events

A web event is an action performed by a customer on a website or in a mobile app. In Smart Communications, web events are objects stored in the database that can be used to build segments, as well as in campaigns and bulk messages.

Web events are linked to an event source (for example, one of several websites or a mobile app).

Along with information about the web event, its context may also be saved. Event context is an object associated with the event. For example, along with the Product added to cart event, the Product object will be saved, i.e., the values of all fields of the product added to the cart.

The object stored in the web event context is static—its attributes retain the values they had at the time of the event. For example, if you display a product price from the web event context in a message text, the customer will see the price at the time of the event, not at the time the message is sent.

This principle underlies the operation of certain triggers, such as Price changed for viewed product.

Methods for receiving information about web events

Smart Communications can receive information about web events in three ways, described below. Regardless of the transmission method, Smart Communications creates an object with the same set of attributes (fields) and available actions.

JS tracker

The JS tracker includes a set of preconfigured web events (such as website authorization or product view), as well as the ability to configure arbitrary custom events (for example, a customer giving a product a low rating).

Mobile SDK

The event method of the Mobile SDK allows transmitting arbitrary web events related to customer activity in the mobile app to Smart Communications. The set of supported events is configured during integration.

REST API

The Partner's master system can transmit information about web events to Smart Communications via REST API calls (Web_event method).

Sessions

A session is a sequence of customer actions on a website or in a mobile app (i.e., a sequence of web events). The session identifier is a mandatory attribute of a web event and allows linking it to the customer.

Within each session, the Customer authorization (user_login) or Website visit (user_visit) event must be transmitted with the session identifier (session_id) and customer identifier in the master system (user_id) fields filled in.

For all other events, transmitting the customer identifier is not required. Events are linked to the customer via the session identifier.

If no user_login or user_visit event with a filled customer identifier field was transmitted within the session (for example, a customer browses products on the site without logging in), the session will be anonymous. Anonymous sessions are stored in the Smart Communications database for 60 days.

Session handling logic differs depending on how web events are transmitted to Smart Communications.

Handling sessions via JS tracker

When a new session starts, the JS tracker creates and sends a cookie file to the client. At the same time, the user_visit event is automatically generated and recorded in the database. Subsequent customer actions will be linked to the session via this cookie. The cookie lifetime is 1 hour, with automatic renewal after each new action.

If the customer has previously logged in to the website and still has a cookie file from a previous session, the JS tracker will automatically fill in the customer identifier field. Additionally, the JS tracker will fill in the customer identifier field if the user arrived at the site via a link from an email campaign.

In other cases, identifying the customer requires transmitting the authorization and registration event (user_login) to the JS tracker. The corresponding code needs to be added to the authorization page.

If the website provides for automatic customer authorization (the "Remember me" function), ensure that the authorization event is transmitted to the JS tracker.

If the cookie lifetime expires and the customer performs a new action, the JS tracker creates a new cookie file and starts a new session.

Handling sessions via Mobile SDK and REST API

When working via Mobile SDK and/or REST API, the logic for grouping events into sessions must be implemented on the Partner's side. Web events are transmitted to Smart Communications using the event method of the Mobile SDK and the Web_event method of the REST API.

When starting a new session, you must transmit the user_login or user_visit event with the session identifier (session_id) and customer identifier in the master system (user_id) fields filled in. All subsequent events must have the session identifier field (session_id) filled.

It is recommended to adhere to the following principles when forming sessions:

  • ensure uniqueness of session identifiers;
  • start a new session if more than 1–2 hours have passed since the customer's last action.