How can I precisely measure session time?

If you want to measure session time more precisely, you can adjust your tracking code to use the heartbeat timer. To set up the code you will use the Piwik PRO tag in Tag Manager.

When you are using this method the session time will be measured more precisely and also the time spent on a page will be more accurate.

To change the measuring of the session time, follow these steps:

  1. Go to Menu > Tag Manager.
  2. Navigate to Tags.
  3. On the left, click Piwik PRO.
  4. Toggle Accurately measure the time spent on each page.
  5. Toggle accurately measure the time spent on each page.
  6. Set the request frequency.
  7. Click Save for the tag and click Publish.

Alternatively, you can add the following line to your tracking code:

setHeartBeatTimer( minimumVisitLength, heartBeatDelay )

Read more about the manual method: JavaScript Tracking Client.

Was this article helpful?

Be the first to rate this article.

Technical Support

If you have any questions, drop us a line at

We’re happy to help!