Return back to the forum, because, this is also solved with JavaScript, and before Tracking will be activated.
Your Matomo URL String:
The User Agent has nothing information to detect the browser as an Headless Browser:
HTTP/1.1" 204 0 "https://www.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.6167.57 Safari/537.36"
So, it is not possible to detect the browser as an Headless Browser.
Inside the matomo.js
are two bassically JavaScript functions are used and integraded in the the Matomo Tracking URL-Querystring as uadata
.
Both don’t work in all browser.
navigator.userAgentData.brands
: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgentData
navigator.userAgentData.getHighEntropyValues.fullVersionList
: https://developer.mozilla.org/en-US/docs/Web/API/NavigatorUAData/getHighEntropyValues
By the second is this needed:
navigator.userAgentData.getHighEntropyValues.fullVersionList
Its an Array/Object, that are used as the value of the key uadata
.
uadata={"fullVersionList":[{"brand":"Not A(Brand","version":"99.0.0.0"},{"brand":"HeadlessChrome","version":"121.0.6167.57"},{"brand":"Chromium","version":"121.0.6167.57"}],"mobile":false,"model":"","platform":"Linux","platformVersion":"5.15.0"}
So, yet we need a JavaScript code that detect Headless
inside this datas. Further, a check is needed of the exist of this functions.
// Edit: deleted, because wrong code (:mebalo)
// new code will be soon.
untested.