Create statistics

Prev Next

You can use certain methods to record statistical information and create CSV files.

Record statistics

Lets the spot collect statistical information and creates a CSV file on the player that is transferred to the server daily.

Parameters

function(value)

value is either a value or several values separated by a semicolon (;) and recorded in the CVS file.

Examples

GFSpotBase.writeStatistic("ProductSelector;547" + ";"+new Date().getTime());

Transfers the app name, product ID 547, and timestamp.

Players

Windows Player version 7.7 or later

Linux Player version 8.0 or later

Android Player version 8.1.0.0 or later

Linux Player

The data is stored in the fs_select table in the statistics database.

Path: /opt/grassfish/data/db/stats.db

Server

The information is stored in a monthly CSV file named yyyymm.csv.

Path: \data\CustomerId\export\select, e.g. \\dev1\GVServer2.dev4\data\1\export\select

Send statistics reports

Allows the spot to send statistical information to the server that collects this data. You can display collected data using a report plugin and a dashboard add-on.

Parameters

function(action, value, dynamicValues, spotIdentifier, sessionIdentifier, pluginGuid)

action is the name for the statistics entry (string).

value is the value to be stored (string).

dynamicValues stores additional information (optional, key-value object).

spotIdentifier assigns recorded data to a spot (optional, string).

sessionIdentifier assigns recorded data to a user who owns a session (optional, string).

pluginGuid stores reports in a dedicated area on the server. You must first create the area and the assigned pluginGuid must be known.

Examples

GFSpotBase.writeSpotReport("Clicked", "547");

Logs the number of clicks on a product for later evaluation. To do so, the type of action and a value (e.g. product ID) are transferred.

GFSpotBase.writeSpotReport("Clicked", "547", {area: "ProductList"});

Optionally, attach additional files such as the area where the product was clicked.

GFSpotBase.writeSpotReport("Clicked", "547", null, "ProductSelector");

Entries can be assigned to a specific spot by defining a spotIdentifer.

GFSpotBase.writeSpotReport("Clicked", "547", null, "ProductSelector", "ddc5d323-9447-41f0-8898-266c486bdddc");

When spots have their own session that allows authorizing users, the session ID can be transferred as well to assign information to users and analyze purchasing behavior.

Player

Windows  and Linux Player version 11.2.0 or later

Send a heartbeat

Lets the spot send a heartbeat to the player to monitor whether the spot is functioning properly.

  • The spot’s heartbeat is activated with the initial transmission of the heartbeat to the player. Until then the player doesn’t look for one.

  • We recommend adding a small buffer when sending the heartbeat, such as a 10 second interval. Send the heartbeat again after 4 seconds so the player doesn’t mistakenly terminate the spot if a request fails to arrive.

Parameters

function(interval)

interval is the time in milliseconds after which the player terminates the spot, if no repeat heartbeat was sent.

Examples

GFSpotBase.sendHeartbeat(10000);

Communicates to the player that the spot will send a repeat heartbeat within 10 seconds.

Players

Windows Player version 8.0 or later

Linux Player version 8.0 or later

Android Player version 8.1.0.0 or later

Log a message

Lets the spot to transfer log messages to the player.

Parameters

function(msg, level)

msg is a string written to the player log files. We recommend specifying the name of the HTML application in order to facilitate debugging.

severity is the degree of severity of the error and is optional. The degree of severity can have one of the following values: Error, Warning, Info, Debug.

Examples

GFSpotBase.sendLog("HTMLApp Error: " + message, GFSpotBase.logLevels.ERROR);

Players

Windows Player version 7.7 or later

Linux Player version 8.0 or later

Android Player version 8.1.0.0 or later