Device Detection of scripts for your website?

Website Device Detecting

After I made my own tracking scripts for fun I noticed a lot of crawlers that I didn’t see showing up in google analytics.  This is what spurred HackerAttitude’s article about NerdyBot a few days ago.

I know now I haven’t been paying attention as well as we should to what bots I allow to crawl my domains.

I started writing a script that would disallow anything with a user agent that didn’t match something of a device.  Then I realized, i’m very much relying on the fact that all the connections aren’t lying about their user agent.  My search began for a device detection that had a better way of doing this.

Device Detector by piwik

My research lead me to check out on github.  It’s looks great.  Simplying  include the php in your header somewhere or use  Composer to install it. (if you’re into that)  It has a large list of devices it’s able to detect.device-detector-result-phantomjs  It was able to detect my desktop perfectly.   However, it mostly failed with phantom showing some all normal mac information then Phantom.

 

 

Detector by dmolsen

Detector is a simple, PHP- and JavaScript-based browser- and feature-detection library that can adapt to new devices & browsers on its own without the need to pull from a central database of browser information.  You can check it out on github.  It seems to work really nice as well.

 

 

The Plan

The plan right now is to test both of these out by implement them both on the same domain at the same time.  I also have an idea I want to try out with getting the user agent and matching the IP with the DNS validator that google has.  Something I got an idea on after reading an article about how good can tell how many domains you own and run.    We’ll post the results back here soon!

 

 

Update:  After looking over these.  I think for athetics of a website, using the “view-port” is really the way to go.  It’s easy and can be quite flexible when using a view-port and resolution.  Further research for this topic is needed and will again have another update in a few months to see if things have changed or if my view point has changed.  (I thought the view-point was funny)

Eddie Dounn

Web developer by day. Enthusiast by night. Owner of VAZED

The HackerAttitude Discussions