This system is based on analyzing the useragent string and looking for the patterns in the useragent string as they have been defined by parties like Google, Microsoft, Samsung and many others. These have been augmented with observations how developers apparently do things. There are really no (ok, very limited) lookup tables that define if a certain device name is a Phone or a Tablet. This makes this system very maintainable because there is no need to have a list of all possible devices.
As a consequence if a useragent does not follow these patterns the analysis will yield the ‘wrong’ answer. Take for example these two (both were found exactly as shown here in the logs of a live website):
Mozilla/5.0 (Linux; Android 5.1; SAMSUNG-T805s Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.94 Mobile Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; SAMSUNG-T805S Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.89 Safari/537.36
The difference between “Mobile Safari” and “Safari” has been defined for Google Chrome as the difference between “Phone” and “Tablet” (see the Chrome documentation on this).
And as you can see in this example: we sometimes get it wrong (The Samsung T805s
is in reality a Tablet).
The impact in this case is however very limited: Of the 445 visitors I found using this device only 2 were classified wrong all others were correct.
Some cases that seem very similar to the previous example are in a way correct.
Take for example the Samsung Galaxy S8 (SM-G950F) which is a Phone.
In normal use the Useragent looks like this:
Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Mobile Safari/537.36
when this device is connected to a computer screen then “Samsung Dex” (Dex = Desktop Experience) takes over and the screen layout and usage of the phone changes dramatically.
Mozilla/5.0 (Linux; Android 9; SM-G950F) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
This time the change (from Mobile Safari
to just Safari
) indicates the device is to be treated as a Tablet
because the screen size and ways of interacting have changed.
When the Samsung Browser is installed on a non-Samsung device (in this example a Google Nexus 6) you get this:
Mozilla/5.0 (Linux; Android 7.0; SAMSUNG Nexus 6 Build/NBD92G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/5.4 Chrome/51.0.2704.106 Mobile Safari/537.36
As you can see this browser assumes it is only installed on Samsung devices so they ‘force’ the word Samsung in there. In this case you will see this being reported as a “Samsung Nexus 6”, which is obviously wrong.
Note that this specific case with the SamsungBrowser
has now been fixed with a set of additional rules so this one is now correctly reported as a Google Nexus 6
.
The detection of the brand and name of the device are the most brittle and unreliable part of the output.
There are a few reasons for this:
So as a consequence I have chosen to limit this detection to
WARNING: The detection of DeviceBrand will therefore never be complete and accurate.