Client Hints tracking
User-agent Client Hints are being rolled out across a number of browsers and are an alternative to the tracking the user-agent, which is particularly useful in those browsers which are freezing the user-agent string. See here for browser support.
This is useful data to capture as browsers are moving away from high entropy user-agent strings. Client Hints offer useful information to understand browser usage without the potential to infringe on a users privacy as is often the case with the user-agent string.
This context be enabled in two ways:
clientHints: true
- This will capture the "basic" client hints
clientHints: { includeHighEntropy: true }
- This will capture the "basic" client hints as well as hints that are deemed "High Entropy" and could be used to fingerprint users. Browsers may choose to prompt the user before making this data available.
To see what will be captured please see the JsonSchema file org.ietf/http_client_hints/jsonschema/1-0-0.
The Client Hints context entity is automatically tracked once configured.
Install plugin
- JavaScript (tag)
- Browser (npm)
Tracker Distribution | Included |
---|---|
sp.js | ✅ |
sp.lite.js | ❌ |
Download:
Download from GitHub Releases (Recommended) | Github Releases (plugins.umd.zip) |
Available on jsDelivr | jsDelivr (latest) |
Available on unpkg | unpkg (latest) |
Note: The links to the CDNs above point to the current latest version. You should pin to a specific version when integrating this plugin on your website if you are using a third party CDN in production.
window.snowplow('addPlugin',
"https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-client-hints@3/dist/index.umd.min.js",
["snowplowClientHints", "ClientHintsPlugin"]
);
npm install @snowplow/browser-plugin-client-hints@3
yarn add @snowplow/browser-plugin-client-hints@3
pnpm add @snowplow/browser-plugin-client-hints@3
import { newTracker } from '@snowplow/browser-tracker';
import { ClientHintsPlugin } from '@snowplow/browser-plugin-client-hints';
newTracker('sp1', '{{collector_url}}', {
appId: 'my-app-id',
plugins: [ ClientHintsPlugin() ],
// Use ClientHintsPlugin(true) to capture high entropy values
});
Context entity
Adding this plugin will automatically capture this context entity.
Example information:
{
"isMobile": false,
"brands": [
{
"brand": "Google Chrome",
"version": "89"
},
{
"brand": "Chromium",
"version": "89"
}
]
}