Detecting iPhone models has always been a bit of a headache for companies working in the online space, mainly due to the fact that device model tokens are missing in the UAs. You won’t find iPhone models in your Google Analytics dashboard which shows a single “Apple iPhone” category for all iPhone models.
Here’s how DeviceAtlas tackles this issue.
The missing iPhone model tokens
Due to the fact that device detection is mainly done via analysing User-Agent strings, it is possible that device manufacturers disable this possibility simply by not providing enough information in the UA. This is what happened in the case of Apple devices which don’t share device model-specific tokens in the UA. The result is that it is not possible to detect iPhone models using a simple keyword-based method which is often used by home-grown device detection solutions.
Here is an example User-Agent string used by an iPhone 8.
Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1
The information contained in the UA says that the device is an iPhone. There’s also information on the OS version and the rendering engine. But there are no tokens containing the exact model name which could be used for detection purposes.
Currently, you can view non-Apple devices in Google Analytics, such as "Xiaomi Redmi Note 4" or "Samsung SM-G610F J7 Prime" as below. However, you'll probably see one device at the top of that list - the "Apple iPhone".
Given Apple’s decision not to share iPhone models in the UAs, the only way to ensure that the right model names are detected is to search for information unique to different models. For this purpose DeviceAtlas uses the Client-side Component, a lightweight JavaScript file which is sent to the user’s device to retrieve some extra information.
DeviceAtlas Client-side component for detecting iPhone models
This technique is used to detect screen resolution, pixel ratio, cookie support, or screen orientation. Here is the full list of client-side properties.
The unique information used by the DeviceAtlas Client-side component to detect iPhone models is the screen aspect ratio. Some iPhones have slightly different screen aspect ratios which are detectable through JavaScript and can be used to effectively distinguish them.
However, the screen aspect ratio in the case of some models is exactly the same, which is why we decided to detect groups of Apple devices with the same screen resolution: iPhone 4/4S, iPhone 5/5S/5C/SE, iPhone 6/6S and iPhone 6 Plus/6S Plus.
Bring device intelligence to your web applications in minutes.
Our Cloud plans provide an easy and affordable way to deploy our award-winning device detection in minutes.
To get started with your free trial, simply create an account and download your preferred option.
More granular iPhone detection
CPU performance is another property that could be analysed in order to get more granular results in terms of iPhone models.
For example, iPhone 6 is powered by a 1.4GHz CPU while iPhone 6S is powered by a 1.84GHz CPU. We tested this approach using the client-side data and for now decided that its impact on the speed of detection may be too high, while the detection accuracy is also unreliable.
Our R&D team is currently researching alternative methods of retrieving more detailed information on iPhone models. We will keep you updated on the DeviceAtlas blog.
UPDATE:
The DeviceAtlas team solved this problem by identifying subtle differences between Apple devices which are distinguishable using the client-side component.
The following table shows iPhone and iPad model detection available with the DeviceAtlas client-side method.
Apple device | Without client-side | With client-side 1.5 |
---|---|---|
iPhone | iPhone | iPhone/iPhone 3G / iPhone 3GS |
iPhone 3G | iPhone | iPhone/iPhone 3G / iPhone 3GS |
iPhone 3GS | iPhone | iPhone/iPhone 3G / iPhone 3GS |
iPhone 4 | iPhone | iPhone 4 |
iPhone 4S | iPhone | iPhone 4S |
iPhone 5 | iPhone | iPhone 5 / iPhone 5C |
iPhone 5C | iPhone | iPhone 5 / iPhone 5C |
iPhone 5S | iPhone | iPhone 5S |
iPhone 6 | iPhone | iPhone 6 |
iPhone 6 Plus | iPhone | iPhone 6 Plus |
iPhone 6S | iPhone | iPhone 6S |
iPhone 6S Plus | iPhone | iPhone 6S Plus |
iPhone SE | iPhone | iPhone SE |
iPhone 7 | iPhone | iPhone 7 |
iPhone 7 Plus | iPhone | iPhone 7 Plus |
iPhone 8 | iPhone | iPhone 8 |
iPhone 8 Plus | iPhone | iPhone 8 Plus |
iPhone X | iPhone | iPhone X |
iPhone XR | iPhone | iPhone XR |
iPhone XS | iPhone | iPhone XS |
iPhone XS Max | iPhone | iPhone XS Max |
iPad | iPad | iPad |
iPad 2 | iPad | iPad 2 / iPad mini |
iPad 3 | iPad | iPad /retina display |
iPad 4 | iPad | iPad Retina (4th Gen) |
iPad Air | iPad | iPad Air / iPad mini 2 / iPad mini 3 |
iPad Air 2 | iPad | iPad Air 2 |
iPad mini | iPad | iPad 2 / iPad mini |
iPad mini 2 | iPad | iPad Air / iPad mini 2 / iPad mini 3 |
iPad mini 3 | iPad | iPad Air / iPad mini 2 / iPad mini 3 |
iPad mini 4 | iPad | iPad mini 4 |
iPad Pro | iPad | iPad Pro |
Below is an example of just some of the further details and device characteristics available for the iPhone 8 Plus.
API input | API output |
---|---|
Apple iPhone 8 Plus | DeviceAtlas ID: 23118940 |
Device Vendor: Apple | |
Device Model: iPhone 8 Plus
|
|
Marketing Name: iPhone 8 Plus
|
|
Manufacturer: Apple
|
|
Year Released: 2017
|
|
Mobile Device: True
|
|
Primary Hardware Type: Mobile Phone
|
|
Touch Screen: True
|
|
Screen Width: 1080
|
|
Screen Height: 1920
|
|
Display PPI: 401
|
|
Device Pixel Ratio:3
|
|
Screen Color Depth: 32
|
|
NFC: True | |
+ 170 further data properties |
Further reading
- iPhone fragmentation - why detecting the model is essential
- How to detect iPhone 8 and iPhone X with DeviceAtlas
- How to detect the iPhone XR, XS and XS Max with DeviceAtlas
- How to use the client-side component for device detection
Get started with a local device detection trial
DeviceAtlas is a high-speed device detection solution used by some of the largest companies in the online space to:
- Optimize UX and conversion rate on mobile
- Boost web performance
- Target ads and analyze web traffic
- Enable App analytics and advertising insights
Get started with a locally-installed trial to test DeviceAtlas at no cost.