Call & Whatsapp

// Before page unload window.addEventListener('beforeunload', () => this.sendFinalHeartbeat(); );

: It updates the "Visit duration" and "Time on page" metrics for the last page of a session, which otherwise default to zero.

startIdleMonitoring() this.idleCheckId = setInterval(() => const idleTime = (Date.now() - this.lastActivity) / 1000;

);

The feature is enabled by adding a single line of code before the tracking code initialization or by using the _paq.push method.