nsc_Visitor.getTimeOnSite()

It returns the integer number of seconds spent by the user on the entire site throughout the current visit.

Example

// For example, let us display the time spent on the site upon the event of clicking the button id = "button1"
document.getElementById('button1').onclick = function() {
    if (typeof nsc_Visitor != "undefined") {    // Let us ensure that the chat widget finished loading and the nsc_Visitor object exists
        alert("You have been on the site for " + nsc_Visitor.getTimeOnSite() + " seconds!");
    }
};

All rights reserved. Copyright © 2017 Netrox SC
Host CMS