User-Agent String Reduction
User-Agent strings have been utilized for a long time to give marketing and development teams crucial information on how browsers, operating systems, and devices display website content and how users engage with websites.
Here is an example of what a User-Agent string looks like on a request coming from a Chrome browser running on a Mac OS device.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Oracle Infinity IQ now supports User-Agent Client Hints, which is a new browser standard and replacing User-Agent strings. User-Agent Client Hints provide website owners access to a lot of the same data found in the User-Agent string in a more private & secure manner.
User Agent Client hints in Infinity IQ
Infinity IQ utilizes User-Agent Client Hints in a couple of ways:
- To augment and derive additional information related to operating systems, browsers, and devices used to visit a website.
- To segment audiences and personalize campaigns.
Browser Support
User-Agent Client Hints were introduced with Google Chrome version 89.
Enabling User-Agent Client Hints
Infinity IQ relies on information included in the client hints when generating reports. If you do not enable client hints in your environment, the Infinity IQ application will not capture the appropriate parameters.
There are two methods to enable User-Agent Client hints. You can use any one of the following methods to enable User-Agent Client hints:
-
Update server to add permissions policy (preferred - most secure), the Permissions-Policy HTTP header
-
Update HTML code with meta content to allow - use the Delegate-CH meta tag in your HTML.
You can decide what you want to collect from the client. Based on that, you can add or remove the following client hints from your configuration.
HTTP Header | Description | Example |
---|---|---|
|
It contains details about the user agent’s brand and version. |
Sec-CH-UA: "(Not(A:Brand";v="8", "Chromium";v="98" |
|
It indicates the brand of the user agent’s platform. |
Sec-CH-UA-Platform: "Android" |
|
It indicates whether the user agent is requesting a mobile layout. |
Sec-CH-UA-Mobile: ?1 |
|
It indicates the version of the user agent’s platform. |
Sec-CH-UA-Platform-Version: "10.0.0" |
|
It indicates the user agent’s full version number. |
Sec-CH-UA-Full-Version: "96.0.4664.110" |
|
It provides the server with details about the full version for each of the brands listed in the Brands list. |
Sec-CH-UA-Full-Version-List: " Not A;Brand";v="99.0.0.0", "Chromium";v="98.0.4750.0", "Google Chrome";v="98.0.4750.0" |
|
It contains information about the architecture’s instruction set. |
Sec-CH-UA-Arch: "x86" |
|
It is an integer value that is greater than or equal to zero and informs the server about the width of the client’s viewport. If this header is omitted then it is assumed to be 1000 pixels wide. |
Sec-CH-Viewport-Width: 320 |
|
It indicates the client’s preference for a reduced data usage mode. It is less of a hint and more of a request because it simply informs the server that the client wants minimal data sent. |
Sec-CH-Save-Data: on |
|
It is an integer greater than zero that indicates the device pixel ratio. For example, if the default representation of an image is 200x100, and the client has sent a value of 2 then the server will return an image that is 400x200. It will include the appropriate Exif metadata with the image to indicate that the original image is 200x100. |
Sec-CH-DPR: 2 |
|
It identifies the user agent’s device model. |
Sec-CH-UA-Model: "Pixel 2" |
|
It describes a connection that is defined by specified ranges of RTT and Downlink values. It does not have information about what the physical connection is but rather, it relies on the network performance information to determine what it most closely matches. The following values were determined through the analysis of real user data
|
Sec-CH-ECT: 2g |
|
It indicates the client’s approximate downstream speed, measured in megabits per second. When considered with RTT, Downlink can be used to help select appropriate content for the client. |
Sec-CH-Downlink: 1.7 |
|
This header indicates approximately how much RAM the device has, in gigabytes. The possible values are 0.25, 0.5, 1, 2, 4, and 8. |
Sec-CH-Device-Memory:0.25 |
|
It is the approximate length of a Round Trip Time, measured in milliseconds. This includes any time that the server spends processing the request. It is helpful because it allows clients to make decisions based on network performance, such as latency. This can help to improve the overall user experience because select resources and responses can be included or omitted accordingly. |
Sec-CH-RTT : 125 |
|
It is an integer value that is greater than or equal to zero and informs the server about the width of the client’s viewport. If this header is omitted then it is assumed to be 1000 pixels wide. |
Sec-CH-Width: 660 |
|
It is an integer value that is greater than or equal to zero, and it informs the server as to the height of the client’s viewport. If this header is omitted then it is assumed to be 1000 pixels in height. |
Sec-CH-Viewport-Height: 1000 |
|
It provides details concerning the bitness of the architecture. For example, the size of a data type in bits or a memory address. |
Sec-CH-UA-Bitness: "64" |
Sec-CH-Prefers-Color-Scheme
|
It indicates the client’s preferred color scheme. Valid options are "light" and "dark". |
Sec-CH-Prefers-Color-Scheme: "dark" |
Sec-CH-UA-Wow64
|
It is a backward-compatible shim for sites relying on "WoW64-ness" (32-bit app running in 64-bit Windows) as they transition from the User-Agent string to UA-CH. It returns a boolean value. |
Update server to add permissions policy
Example
# For configuring the server, in the case of Apache, you need to add the below configuration to the server configuration file:
Header set Accept-CH "sec-ch-ua-platform-version, sec-ch-ua-full-version, sec-ch-ua-wow64, sec-ch-ua-arch, sec-ch-viewport-width, sec-ch-save-data, sec-ch-dpr, sec-ch-ua-model, sec-ch-ect, sec-ch-downlink, sec-ch-device-memory, sec-ch-rtt, sec-ch-width, sec-ch-viewport-height, sec-ch-ua-bitness, sec-ch-ua-full-version-list, sec-ch-ua, sec-ch-ua-platform, sec-ch-ua-mobile, sec-ch-prefers-color-scheme"
Header set Permissions-Policy 'ch-ua-platform-version=(self "https://dc.oracleinfinity.io"), ch-ua-full-version=(self "https://dc.oracleinfinity.io"), ch-ua-wow64=(self "https://dc.oracleinfinity.io"), ch-ua-arch=(self "https://dc.oracleinfinity.io"), ch-viewport-width=(self "https://dc.oracleinfinity.io"), ch-save-data=(self "https://dc.oracleinfinity.io"), ch-dpr=(self "https://dc.oracleinfinity.io"), ch-ua-model=(self "https://dc.oracleinfinity.io"), ch-ect=(self "https://dc.oracleinfinity.io"), ch-downlink=(self "https://dc.oracleinfinity.io"), ch-device-memory=(self "https://dc.oracleinfinity.io"), ch-rtt=(self "https://dc.oracleinfinity.io"), ch-width=(self "https://dc.oracleinfinity.io"), ch-viewport-height=(self "https://dc.oracleinfinity.io"), ch-ua-bitness=(self "https://dc.oracleinfinity.io"), ch-ua-full-version-list=(self "https://dc.oracleinfinity.io"), ch-ua=(self "https://dc.oracleinfinity.io"), ch-ua-platform=(self "https://dc.oracleinfinity.io"), ch-ua-mobile=(self "https://dc.oracleinfinity.io"), ch-prefers-color-scheme=(self "https://dc.oracleinfinity.io")'
Note: These URLs (https://dc.oracleinfinity.io) change if you are GDPR and sending data to a specific data center. Check your Tag to see which server you're using in the data collection endpoint and make sure you use that endpoint in the above configuration.
Update HTML code with meta content to allow
<meta name="accept-ch" content="sec-ch-ua-platform-version=("https://dc.oracleinfinity.io"), sec-ch-ua-full-version=("https://dc.oracleinfinity.io"), sec-ch-ua-wow64=("https://dc.oracleinfinity.io"), sec-ch-ua-arch=("https://dc.oracleinfinity.io"), sec-ch-viewport-width=("https://dc.oracleinfinity.io"), sec-ch-save-data=("https://dc.oracleinfinity.io"), sec-ch-dpr=("https://dc.oracleinfinity.io"), sec-ch-ua-model=("https://dc.oracleinfinity.io"), sec-ch-ect=("https://dc.oracleinfinity.io"), sec-ch-downlink=("https://dc.oracleinfinity.io"), sec-ch-device-memory=("https://dc.oracleinfinity.io"), sec-ch-rtt=("https://dc.oracleinfinity.io"), sec-ch-width=("https://dc.oracleinfinity.io"), sec-ch-viewport-height=("https://dc.oracleinfinity.io"), sec-ch-ua-bitness=("https://dc.oracleinfinity.io"), sec-ch-ua-full-version-list=("https://dc.oracleinfinity.io"), sec-ch-ua=("https://dc.oracleinfinity.io"), sec-ch-ua-platform=("https://dc.oracleinfinity.io"), sec-ch-ua-mobile=("https://dc.oracleinfinity.io"), sec-ch-prefers-color-scheme=("https://dc.oracleinfinity.io")">
Where https://dc.oracleinfinity.io
is the domain name of the collection server.