HI
I find several visits (especially those coming from campaigns) with only the reload action of the landing page, this alters the data on the duration of the session and the bounce rate. Is there a way to remove reload actions from the reports? Possibly not permanently?
PS.
Alternatively, how would you create a segment to include users who have visited at least 2 different pages?
Your initial question is not so easy to solve. Because the tracking after reloading are deactivated. An afterwards deleting of tracking is not possible, respectivelly only with a database cleaning. Matomo don’t collect the tracking data and send it at a later time. It’s live tracking.
Deactivate the tracking on a page after reload page:
embeed the _paq.push(['trackPageView']); in a if rule.
if ((("performance" in window) === true) && window.performance.navigation.type === 0) {
_paq.push(['trackPageView']); // enable tracking only on pages without reload
}
The initial value of type is 0. This value is setted after a page reload to 1.
Consider, older browsers don’t have this function. With this no tracking is activated on all pages. For this here is an alternative solution:
if (("performance" in window) === false) {
_paq.push(['trackPageView']); // enable tracking if the function is missing
} else {
if (window.performance.navigation.type === 0) {
_paq.push(['trackPageView']); // enable tracking only on pages without reload
}
}
if ((window.performance.getEntriesByType("navigation")[0] != undefined) && (window.performance.getEntriesByType("navigation")[0].type != 'reload')) {
_paq.push(['trackPageView']); // enable tracking only on pages without reload
}
or
if (window.performance.getEntriesByType("navigation")[0] == undefined) {
_paq.push(['trackPageView']); // enable tracking if the data is missing
} else {
if (window.performance.getEntriesByType("navigation")[0].type != 'reload') {
_paq.push(['trackPageView']); // enable tracking only on pages without reload
}
}
New informations about that matter with the tracking of reloaded pages as regular page visits are available.
Mobile devices browser reload a webpage every time when the user swipe the webpage over the top or bottom. This feature is default activated and can be deactivated in the settings under Customize → Gestures → Pull to refresh
@heurteph-ei
This default activated Pull to refresh feature is a big problem in tracking. So, matomo should be included by default a solution like above.
New, additional methode.
From Matomo hint for search pages.
Matomo wrotes: On site search result pages, don’t use trackPageView. Use trackSiteSearch instead of trackPageView. The case of reload pages is similar to site search result pages, but don’t need a trackSiteSearch. Replace it with a ping.
@MisterGenest , the matter is very complicated, because it bothers many others.
Yet, in my self coded Matomo Tracking Script, i must deactivate the rule with the window.performance.getEntriesByType("navigation")[0].type, because it bothers event tracking after reload.
The last code, post from me here, withe the restriction of the _paq.push(['trackPageView']); is better.
by the way: The rule with the window.performance.getEntriesByType("navigation")[0].type was only in my self coded tracking code suboptimal, because it deactiveted the tracking complete by a page reload.
So far so good, we can merge both rules and restricted with it the trackPageView.
var matomo_trackPageView_bool = true;
if ((document.referrer.toString() == window.location.href.toString()) === true) {
matomo_trackPageView_bool = false;
}
if (window.performance.getEntriesByType("navigation")[0] != undefined) {
if (window.performance.getEntriesByType("navigation")[0].type == 'reload') {
matomo_trackPageView_bool = false;
}
}
if (matomo_trackPageView_bool === true) {
_paq.push(['trackPageView']);
} else {
_paq.push(['ping']);
}