Goals based on visit duration do not seem to be tracked correctly

Hello everyone,

I have enabled “HeartBeatTimer” in the tracking code and set a goal based on the visit duration that is reached after 30sec.

However, the goal is only set if the user has been on the page for longer than 30 seconds AND a second pageview has taken place.

In the case of a visit with only one pageview and a visit duration of > 30 sec, no goal is reached.

Can this behavior be changed?

Hi @joe-fred

If I understand well, you want a visitor reach the goal when he stays in your site more than 30 seconds, either he visits only one page or he visits more…

Can you share this code? And also how you configured the goal?

Hi @heurteph-ei,
you have understood my request correctly.

The tracking code is:

var _paq = window._paq = window._paq || [];
(function() {

and here the goal config:

Hi @joe-fred
Just to be sure:
Which version of Matomo do you use?
Do you use the sendbeacon?

Also, what happens (for your goal) if you stay 20 seconds on Page 1 then 20 seconds on Page 2, then quit the website?

iam using 5.0.2.
no sendbeacon is used.

made some further tests:

  • goal is also not set when i stay 20 sec on page 1 and 20 sec on page 2.
  • goal is only set if I was on a page for longer than 30 seconds and this pageview was not the last one

Hi @joe-fred
I think you have to create a new issue at: