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.Tracker.SendEvent method is provided for that.
Finteza.Tracker.SendEvent("{EVENT}", "REFERER"); |
Using this method, you can register the events and pass additional information as parameters, for example, a type of a purchased good, price, currency, etc. The following parameters are supported:
Parameter |
Type |
Description |
---|---|---|
name * |
string |
Event name. The maximum length is 128 symbols. |
referer * |
string |
The address of the page from which the event is sent. 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. |
backReferer |
string |
The address of a web page a visitor was located at before performing a tracked action. |
userIp |
string |
The IP address of the visitor who performed a tracked action. |
userAgent |
string |
The user-agent of the visitor who performed a tracked action. |
unit |
string |
Parameter measurement units, for example, USD, items, etc. The maximum length is 32 characters. |
value |
string |
The value of the parameter. The maximum length is 64 symbols. |
* – required parameters.
Example:
Finteza.Tracker.SendEvent("Server Track Purchase", "https://www.mysite.com", "USD", "100"); |
There is no need to specify the referer parameter each time the event is sent, if you set its default value during initialization. During Finteza.RegisterAnalytics call, specify the additional parameter defaultReferer:
Finteza.RegisterAnalytics(websiteId: "{WEBSITE_ID}", defaultReferer: "{DEFAULT_REFERER}"); |
Note: If you do not use defaultReferer, specify referer during each SendEvent call. Otherwise, the events will not be sent. |
Another variant is available for the Finteza.Tracker.SendEvent function:
Finteza.Tracker.SendEvent({CONTEXT}, "{EVENT}"); |
Instead of the explicit specification of referer, backReferer, userIp, userAgent, here the request execution context is specified, from which the specified parameters will be received and sent to Finteza.
Parameter |
Type |
Description |
---|---|---|
httpContext * |
System.Web.HttpContextBase or System.Web.HttpContext |
Current HTTP request execution context, from which parameters referer, backReferer, userIp and userAgent are automatically formed. |
name * |
string |
Event name. The maximum length is 128 symbols. |
unit |
string |
Parameter measurement units, for example, USD, items, etc. The maximum length is 32 characters. |
value |
string |
The value of the parameter. The maximum length is 64 symbols. |
* – required parameters.