Event tracking
Everything your customers do is recorded in the system. What pages they’ve opened, where they came from, and what they saw next. You will know when they hovered over a banner for a longer time than usual and when they clicked that banner. You can know when they logged in to your mobile application and what parts of that application they’ve clicked or interacted with - all events are monitored in real time. In addition to what is gathered automatically, you can declare many different types of events and gather as much data as you need by tagging fields in your web forms.
All events have at least the following:
- action - indicates the action type, in the form
context.activity
, so, for example,page.visit
means that a page has been visited - time - the time when the event occurred
- uuid - a reference to the customer that generated the activity
- params - any additional parameters, some of them are required (depends on the activity context, for example, the url of the page for a
page.visit
)
To see the parameters required by events which exist in Synerise by default, see the API Reference.
Authentication
Requests to the SDK may require customer authentication. For more details, see this article.
Automatically tracked activities
All page view events on your website are tracked automatically, unless configured otherwise (see installation and configuration). The same applies to events related to the customer session.
Each time a page is refreshed, the tracking code is initiated. At this moment, a page.visit
event is generated, providing information about the page visited by the customer. This means that for single-page applications, which do not refresh between pages, the page.visit
event must be sent on-demand, as described here.
List of automatically tracked activities
Action | Activity Tracked | Label |
---|---|---|
page.visit | All page views of your tracked domain | Visited page {{page title}} |
session.start | Information about a customer starting a session | Started session |
session.end | Information about a customer ending a session | Session end |
Declarative tracking (custom events)
transaction.charge
events. Transactions must be tracked as described in Transactions.Aside from automatically tracked activities, you can also create custom events that record customer actions.
This could be the tracking of all product views, screen views, sign-up button clicks, call-center contacts, or anything else you may want.
When using the JS SDK, you can only send custom events that are defined in Data Management > Events and have at least the Make this event available to anonymous profiles without JWT option selected in their permission settings.
Events with action names that are not defined in the system are rejected.
Parameters that are not defined in the system are saved to a database, but their definitions are not added automatically to the Data Management module and the parameters are not available in analytics and some APIs.
Example:
|
|
The method takes two arguments:
- The name of the action. (line 2)
- An object that contains optional event parameters (lines 3-13)
- The action name must follow the
context.action
convention. For example:screen.view
,product.buy
,social.share
- The action name must be up to 32 characters long and must match the following regular expression:
^[a-zA-Z0-9\.\-_]+$