Clientside Event

Sends a clientside tracking event to the sitesights.io backend. 

 

There are a lot of use cases to send events like tracking clicks on specific buttons or track goals when visitors click on an action like buy after they entered through your ad with utm parameters.

When an event is sent, it will first check if it currently has utm parameters or the gclid parameter attached, if not, it will automatically look for those in the first page view of this visitor's session.

If you want to know more about the ClientId Parameter, you should checkout the following this link.

options object required

Set of all options for the event

Name string required

The name of the event. Typically it is some sort of category like social-button or purchase.

Maximal length: 1000 characters

.

Parameters array<object> required

The list of parameters of this event.

Maximal length: 12 parameter objects

array element object

Object representing a parameter.

Name string required

Name of the parameter, example for category social-button would be type.

Maximal length: 200 characters

Value string required

Value of the parameter, example for category social-button would be facebook.

Maximal length: 2000 characters

ClientId string or null

Optional string identifier to identify current visitor. This is very specific to your website, for example if a lot of your users have an account and are logged in. You could use their Unqiue Account ID here (This will be hashed beyond recognition) or if you get the permission of your visitor, you can use something like fingerprinting. For a much more detailed explaination, please go here.

Although we offer high limits like 2000 characters for parameter values, we would recommend not to push that limit for high frequency events. It also wouldn't be as nice in the dashboard to look at enormous strings.

Example of sending a social link button click of instagram without any custom ClientId.

Social link
MDAL.event({
    "Name": "social-link",
    "ClientId": null, // optional: better tracking
    "Parameters": [{
        "Name": "type",
        "Value": "instagram",
    }] //list of parameters
});

ClientId Parameter

Read more