Logged incorrect android version
I recently noticed that the wrong Android versions are being registered for Chrome users. As far as I understand, this is the problem https://developers.google.com/privacy-sandbox/blog/user-agent-reduction-android-model-and-version. Tell me how this can be fixed?
Hey @BelkinVadim , Thanks for pointing this out! We'll look into this and let you know.
Hey @BelkinVadim,
It looks like there are a few things that need to happen to fix this issue. First, you need to add the Sec-CH-UA headers when serving your website that allow these values to be read. I believe they need to be:
Accept-CH: Sec-CH-UA-Mobile, Sec-CH-UA-Platform, Sec-CH-UA, Sec-CH-UA-Model
Additionally, if you reference our agent from cdn.trackjs.com you'll need to add the appropriate Permissions-Policy header as well. However, I'd recommend you bundle our agent with your code via npm instead.
Once you've done that, we should be able to get access to the data with the new APIs. However, we're probably not going to implement this just yet as it's pretty likely to change or be abandoned in our opinion. So in the interim, we recommend you use the UA CH retrofill package to your app and calling overrideUserAgentUsingClientHints in your code. This will force the correct userAgent string to be written.
Here's an example:
import { TrackJS } from 'trackjs';
import { overrideUserAgentUsingClientHints } from './uach-retrofill.js';
overrideUserAgentUsingClientHints(["uaFullVersion"]);
TrackJS.install({...});
Note that this will only work if you give the page the correct permissions with the headers above.