Categorizr - A modern device detection script

Categorizr is a modern device detection script that helps categorize different web capable devices into 4 categories, desktop, tv, tablet, or mobile. It take’s traditional device detection and flips it on it’s end, assuming devices are mobile first, unless otherwise detected as tablet or desktop. Categorizr was created by Brett Jankord and is based on an my earlier device detection script.

You can download Categorizr from github here: https://github.com/bjankord/Categorizr

Developers can include Categorizr on their site to detect if a device is a desktop, tv, tablet, or mobile phone. With these 4 categories, you can choose what you want to do when a user accesses your website from varying devices. Originally the script was written with the idea in mind of using it as a solution to creating a hybrid responsive web site. Though you could also use it for traditional mobile redirects.

What makes Categorizr different?

Instead of assuming the device is a desktop, and detecting mobile and tablet device user agents, Categorizr is a mobile first based device detection. It assumes the device is mobile and sets up checks to see if it’s a desktop or tablet. Desktops are fairly easy to detect, the user agents are known, and are not changing anytime soon. Tablets are also pretty easy to detect.

By assuming devices are mobile from the beginning, Categorizr aims to be more future friendly. When new phones come out, you don’t need to worry if their new user agent is in your device detection script since devices are assumed mobile from the start.

Categorizr test results.

I’ve set up a page where you can view a cross-check of Categorizr against over 10,500+ user agents. The cross-check includes data from WURFL along with some user agents from http://goo.gl/sRA2X, http://goo.gl/p0dhR, and a few other places across the web. I’ve also cross-checked Categorizr on all the devices I could get my hands on at Best Buy, Verizon, AT&T, T-Mobile, and Sprint.

You can test your own devices and other user agents against Categorizr here. If you come across any devices you think are categorized incorrectly, let me know in the comments below, I’ll see what I can do to catch them in the script.

So far in testing Categorizr, I’ve seen really positive results, though with any kind of device detection where you’re checking user agents, there is going to be some chance of error. In the 10,500+ user agents tested so far, I did come across some issues. You can read about them here. Known issues with Categorizr. I would strongly encourage developers to add a link to let the their user decide what view they want, be it the mobile version, desktop version, or whatever other version you decide.This will help ensure if initial detection is incorrect, the user can still get to an optimized version suited for them.

Updated – 2.6.12
A category for TVs has been added to Categorizr. Smart TVs and TV based gaming consoles like the Nintendo Wii and Playstation 3 are now categorized as TVs. SmartTV’s categorized as a TV include Google’s Android powered TVs, Philips Net TVs, and Samsungs Smart TVs. I have been unable to get any information about the user agents from LG’s smart TVs so I’m unsure what category they would fall into. http://goo.gl/ZSDUc

If you know of other smart TVs that are not categorized correctly, let me know and I’ll see what I can do to update Categorizr.

Updated – 2.29.12
Categorizr
is ready to download.

You can download Categorizr from github here: https://github.com/bjankord/Categorizr

It comes in two flavors, Categorizr and Categorizr-Redirect.
If you looking to create a hybrid responsive wed design, go with Categorizr. If your looking for more traditional redirect, go with Categorizr Redirect.

A WordPress plugin is in the works.

If your using Cateogrizr on a bigger site, let me know. I’d love to know how/where below are using it. Comments, concerns, questions, let me know in the comments below.