For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

▪️Events and actions

Use these calls of the Smartico script to report what the player does on your site: session events, the login entry point, custom actions, custom events, JS markers and UTM fields. You can use them to start campaigns, automation rules and missions.

Online, offline, login, and logout events

Smartico has 4 main events related to user session tracking

  • user_went_online - happens whenever the user is refreshing the page, or navigating between the pages of the site, and also in case when the connection is lost and restored (happens especially on mobile devices), but not more often than once in 1 minute.

  • user_went_offline - happens when connection with user is lost. In general, when user is closing a page/browser, or moving browser application in the background on mobile device. Important to note that it doesn't happen immediately because of different browsers/applications behaviour. Delay could be quite variable. Smartico is not allowing to use this event as trigger for campaigns, missions, automation rules or anything else in order to avoid confusion.

  • login - is the Smartico logic of identification of a new session. When the user logs in for the first time, Smartico generates the "login" event. In the next 30 minutes, if the user is refreshing the page or navigating between the pages, the "login" event will not be reported. If a different user logs in on the same browser, the "login" event is reported right away. If the user does log out on your site, your front-end developers need to report logout action explicitly using _smartico.logout() javascript call, or set window._smartico_user_id to null as described in Front-end integration. If this is not done, on the next login within a 30-minute time window, Smartico will not trigger the login event again

  • user_logged_out - not managed by Smartico in any way, because Smartico is not aware when the user is doing logout. This event need to be triggered explicitly using _smartico.logout() JavaScript call. When you set window._smartico_user_id to null (or an empty value) after a user was identified, the script calls _smartico.logout() for you. If the Acquisition product is enabled on your setup, the script does not send this event.

Last login entry point

You can set a property "Last login entry point" and segment users by it or react when they are logging in from a specific entry point.

This is useful, in case the integrated website has different entry points, for example - there is a lobby, landing page, user profile, etc. Or there are different device types that can be used to log in, like mobile, desktop, app, TV, etc.

The entry point can be reported in the following way:

_smartico.setLoginEntry('LOBBY')

You can pass any string value as the entry point, but the number of different entry points per label is limited to 50.

Custom actions / Client action

You can report a specific action done by the end-user, for example when the user is clicking on the submit button on the cashier page, you can report the action 'CashierSubmitClicked'.

Example:

As soon as the action is defined and triggered at least once, you can build a real-time journey to react to such an action

Real-time journey to start campaign when user does specific action

You can also report custom data as part of the event and later evaluate it in the Journeys / Realtime automation rules / Missions or any other mechanics that are based on the real-time events.

For example:

In the backoffice, in the Query Builder you can validate the value of the event payload (read Query Builder article for more details about event evaluation)

In some cases, you will want to start a campaign when the user is getting to a specific page.

One of the options is to pass a special parameter in the URL of any of your pages.

For example, you can build a URL like

When a user comes on this page you can catch him with the campaign waiting for the "Core: client action" and action DEPOSIT_OPENED

Example of the campaign

Note: the passed parameter in the URL is URL Encoded. You can pass any deep links that will be triggered automatically after the user is logged in, except dp:go and deep links that carry a url parameter: the script ignores them. You can put _smartico_dp after # (as in the example) or in the query string after ?. The script runs the deep link about 1 second after the user is identified.

JS markers (public tags)

There is a possibility to put markers on the user from the campaign flow or with automation rules and use these markers on the front end.

When the marker is set to the user, you are able to use it in the front end using the following code.

You can also update JS markers from the client side with JavaScript, e.g.

Client-side events

You can report events in the context of identified end users via Smartico JS SDK.

Public channels are considered as not trusted, those should be used only for non-sensitive events like - the user navigating to a specific screen, clicking on some elements, etc.

Example:

The payload of the event is passed as JSON object with any structure and data types.

Before reporting any custom events, please contact the Smartico Customer Success Manager to align the data that will be reported and how it should be processed by the Smartico system.

Smartico team will need to register such events and define rules for processing and storing payload

Setting UTM fields on the user profile

Smartico has two fields to hold UTM parameters - core_utm_source and core_utm_campaign.

These fields can be set via server REST API or can be also set from the front-end

Frequently Asked Questions (FAQ)

Why does the login event not trigger on every page navigation?

Smartico applies a 30-minute session window to prevent duplicate login events on page refreshes and routine navigation. A login event is generated only on the first login in a new session, after 30 minutes of inactivity, immediately when the logout method was explicitly called during the user logout flow (or window._smartico_user_id was set to null), or when a different user logs in on the same browser.

Last updated

Was this helpful?