
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](https://developers.synerise.com/DataManagement/DataManagement.html#tag/Events).

## Authentication

Requests to the SDK may require customer authentication. For more details, see [this article](/developers/web/jwt-auth).

## Automatically tracked activities

All page view events on your website are tracked automatically, unless configured otherwise (see [installation and configuration](/developers/web/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](/developers/web/methods-reference#send-a-pagevisit-event).

### 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)


<div class="admonition admonition-warning"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z" /></svg></div><div class="admonition-body"><div class="admonition-content">

DO NOT use custom events for `transaction.charge` events. Transactions must be tracked as described in [Transactions and basket events](/developers/web/transactions-sdk).

</div></div></div>


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.


<div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

When using the JS SDK, you can only send custom events that are defined in [**Data Modeling Hub > Events**](/docs/assets/events/event-definitions) and have at least the **Make this event available to anonymous profiles without JWT** option selected in their permission settings.  <br>

Events with action names that are not defined in the system are rejected.  <br>

Parameters that are not defined in the system are saved to a database, but their definitions are not added automatically to Data Modeling Hub and the parameters are not available in analytics and some APIs.

</div></div></div>


**Example:**

<pre><code class="language-javascript">SR.event.trackCustomEvent(
    "entries.count", // event action name
    { // additional parameters
        "lat": "50.0937",
        "lon": "18.5429",
        "object": "Shopping center",
        "shopId": "S198",
        "shopName": "Chicago",
        "zipCode": "60639",
        "street": "W North Ave",
        "time": 1556474400000,
        "entries": 27
    }
)</code></pre>


The method takes two arguments:

+ The name of the action. (line 2)
+ An object that contains optional event parameters (lines 3-13)


  <div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

  - 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\.\-_]+$
      ```

  </div></div></div>


