Sending events

SDK allows sending any events from the server part of your website to Finteza, including user action data, database status, performance indicators, etc. The finteza.sendEvent() method is provided for that.

const finteza = require("finteza-sdk");
 
// sending event
finteza.sendEvent({
  name: "Server Track Test",
  websiteId: "lopvkgcafvwoprrxlopvkgcafvwfzsrx"
});

Set the following parameters when calling finteza.sendEvent():

Parameter

Type

Description

name *

string

Event name. The maximum length is 128 characters.

websiteId *

string

Website ID. It can be obtained in the website settings (ID field) of the Finteza panel.

url

string

Finteza server address. In most cases, it should not be changed.

referer

string

All events are bound to counters (websites) on Finteza side using the websiteId. The system makes sure that a host an event has arrived from corresponds to the counter host (specified in the website settings of the Finteza panel). This prevents inflating traffic.

 

By default, a host the SDK works on (defined automatically) is specified when sending events. If necessary, you can re-define it using the referer parameter.

* – required parameters.

Additional data in the event parameters #

In events sent to Finteza, you can specify additional data as parameters, for example, a type of a purchased good, price, currency, etc.

finteza.sendEvent({
  name: "{EVENT}",
  websiteId: "{WEBSITE_ID}",
  unit: "{UNIT}",
  value: {VALUE}
});

Specify the event name and website ID, and set the additional parameters:

Parameter

Type

Description

unit

string

Parameter measurement units, for example, USD, items, etc. The maximum length is 32 characters.

value

number

Parameter value. The maximum length is 64 characters.

Example:

finteza.sendEvent({
  name: "Server Track Purchase}",
  websiteId: "lopvkgcafvwoprrxlopvkgcafvwfzsrx",
  unit: "USD",
  value: 100
});