Not really by “after 2 actions”. One-Page-Visits have default no “Time on Page”, because an “action” is missing. An “action” is default a link click (next page), when link click tracking is activated.
_paq.push(['enableLinkTracking']);
For hidden “actions” detecting, there is the heartbeattimer, but that is not an interval since shes function was changed for 2 years. It detect page leave and similar. It has a timeout, also starts after x seconds. The minimum is 5 seconds.
_paq.push(['enableHeartBeatTimer', 5]);
Further you can use the matomo ping
with own functions like this:
window.addEventListener('beforeunload', function(e) {
_paq.push(['ping']);
});
or for a real heartbeat interval for the first 11 seconds.
var matomoheartbeat = setInterval(function() {
_paq.push(['ping']);
}, 1000);
setTimeout(function() {
clearInterval(matomoheartbeat);
}, 11000);
all after/below _paq.push(['trackPageView']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['enableHeartBeatTimer', 5]);
window.addEventListener('beforeunload', function(e) {
_paq.push(['ping']);
});
var matomoheartbeat = setInterval(function() {
_paq.push(['ping']);
}, 1000);
setTimeout(function() {
clearInterval(matomoheartbeat);
}, 11000);
apart from that, it is possible, that the devices / browsers / browser plugins on the viewer-side block the tracking in details. In my matomo i have every time few visits without pagename or completly without time on page (not even 0 seconds).