JSMon API

(version 1.2.1)

Basic Entities

Monitoring system is based on three basic entities.

  1. Tracking Actions

    Tracking Actions are visitors' potential actions on the site which are important and used for behavior analysis. For example, it can be news subscription. It informs the site that visitor is interested in information and loyal in general. Tracking Action is presented in form of unique code, textual description and a set of optional parameters defined by the site owner as well.

    Examples of Tracking Actions:

    1 - News subscription

    E-mail

    2 - Create account

    login

    E-mail

    3 - Log in

    login

    VIP-client

    4 - Log out

    5 - View special promo page

  2. Response Signals

    Response Signals are the data sending to the site when this or that condition is found to be true. Also they are presented in form of unique code, textual description and a set of optional parameters.

    Examples of Response Signals:

    1 - Offer a discount

    Discount

    2 - Show details

    Product ID

    URL

    3 - Show Invite Friends form

  3. Conditional Statements

    Conditional Statements are the sets/combinations of simple conditions based on which the site owner determines the logic of interaction with visitor. Tracking Actions and system parameters act as conditions and Response Signals act as statements. The system parameters include as follows: time on site, number of visits, number of pageviews, search query, domain from which the visitor came, and etc.

    On each request to JSMon server is checked whether conditions are true and if so then signals are returned to the site where the site owner defines what is to be done further.

    Examples of Conditional Statements:

    1) Assume we want to offer coupon to all our VIP clients who came today per search queries "discount" or "sale", provided that they visited our site recently. The conditional statement in the system will be set the following way:

    If

    3 - Log in

    VIP-client == 1

    5 - View special promo page

    User Information

    Search Query == discount | special | sale

    Pageviews > 2

    Time on Site > 120 seconds

    Time from Last Visit < 10 days

    Then

    1 - Offer a discount

    Discount = 20%

    2) Another example, we would like to attract new clients and for this purpose we define the most loyal visitors, for instance, those ones who subscribed for news, and show them the special form of inviting his friends to visit the site.

    If

    User Information

    Total Visits > 1

    Pageviews > 5

    Time on Site > 300 секунд

    1 - News subscription

    Then

    3 - Show Invite Friends form

    So, having set the necessary behavioral models on the site it is possible to interact with visitors on line, responding their needs, enhancing their loyalty and increasing conversion thereby.

JSMon Install

To start using JSMon on your site it is necessary to insert several code lines:

<!-- loading script -->

<!-- you can host the script on your site -->

<script src="//jsmon.com/track-1.2.1.min.js"></script>


<script>

// callback function

// called when the page is loaded, and in the case of

// user makes tracking actions

// the input is a set of properties

function callback_function(properties) {

for (var p in properties) {

// p - parameter name

// properties[p] - parameter value

}

}


// variable to store the object JSMon

var jsmon = false;


// JSMon initialization

jsmon = _JSMON({

siteID: "u0000", // u0000 - your site code

listener: callback_function // callback function

});

</script>

To inform the system about any of visitors' actions the following function is used:

trackAction (action_id, params)

action_id - ID of the tracking action

params - a set of additional parameters if required


// example of use

if (jsmon)

jsmon.trackAction(2, {"Product ID" : "123", "URL" : "/help/"});

In case, even one of the conditions is true then the callback function will receive corresponding signals every time. Upon receiving such signal it can be processed (your site can interact somehow with user) or not. After that the signal is not required anymore. To inform the system that the signal has been processed and it is not required to send it to the site anymore the following function is used:

signalProcessed (signal_id)

signal_id - ID of the returned signal


// example of use

if (jsmon)

jsmon.signalProcessed(2);