I just noticed an issue where a referrer attribution cookie is not set when no tracking request is sent at all while viewing a page.
This is a bug because the original referrer will go lost. If the next page does track data, then the previous page will become the referrer (where no data was tracked) instead of the original referrer.
I assume it's rarely the case that no data is tracked on a landing page so might not be a big issue.
This could be an issue especially with implemented consent managers. Mostly, consent managers are implemented poorly (not using the out-of-the-box consent methods) given consent is not triggering tracking on the same page, but on the second one after giving consent). So this could fix quite some "lost" referrers that are being reported as "direct".
👍 good one. In that case we could likely fix this similar to https://github.com/matomo-org/matomo/pull/18135/files by setting the referrer cookie when leaving the page assuming cookies are enabled.
@peterbo if consent hasn't been given yet, then the cookie might not be set either so it wouldn't help. But I think what you're saying might be that consent managers are not correctly implemented as in they might enable cookies, but not send a tracking request on the page eg because they do a reload once consent given and then measure the page?
they might enable cookies, but not send a tracking request on the page eg because they do a reload once consent given and then measure the page
Hey @tsteur - exactly! You definitely phrased it better than I did. ;)