How to precisely measure the session time?

If you want to measure the 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.

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. Set the request frequency.
  6. 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!