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 FintezaAnalytics::event() method is responsible for that.

// import
include"{SDK_PATH}\finteza-analytics.php" );
 
// send an event
FintezaAnalytics::event( array(
    'name' => '{EVENT}',
    'websiteId' => '{WEBSITE_ID}'
) );

Include the SDK file by setting its path in {SDK_PATH}. Then call FintezaAnalytics::event() with the following parameters:

Parameter

Type

Description

name *

string

Event name. The maximum length is 128 symbols.

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.

FintezaAnalytics::event( array(
    'name' => '{EVENT}',
    'websiteId' => '{WEBSITE_ID}'
    'unit' => '{UNIT}',
    'value' => '{VALUE}'
) );

Set the event name and the website ID and then specify additional parameters:

Parameter

Type

Description

unit

string

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

value

number

Parameter value. The maximum length is 64 symbols.

Example:

FintezaAnalytics::event( array(
    'name' => 'SERVER+TRACK+PURCHASE',
    'websiteId' => 'sbnopromrvdebluwjzylmbhfkrmiabtqpc'
    'unit' => 'USD',
    'value' => '100'
) );