WordPress.org

Support

Support » Plugins and Hacks » How to detect the OS?

How to detect the OS?

  • Is there a way to detect if a user is using debian, ubuntu, windows XP/Vista? Using javascript/php I know how to detect if the user is using linux with javascript but not the specific distribution

Viewing 6 replies - 1 through 6 (of 6 total)
  • If you track your blog with Google Analytics, it also tracks the visitors OS for you.

    hmm I need get it into variable to print it on a certain part of the page, google analytics can do that? -I just registered the site and included the script on the index but it doesn’t display nothing on the google dashboard-

    Here’s a plugin that does some detection for comments. Perhaps you can see how they do it for your own purposes?

    http://priyadi.net/archives/2005/03/29/wordpress-browser-detection-plugin/

    Google Analytics doesn’t show “real-time” data. You have to wait until the day is over to see the data for that day. Check after midnight. You’ll see the data. It’ll be under Visitors -> Browser Capabilities -> OS (on the left).

    If you include the Google Analytics script into your theme’s header. It’ll be included in all your pages/post, which means it tracks your entire blog…not sure if that was what you were asking.

    Vicfred,

    Is there a way to detect if a user is using debian, ubuntu, windows XP/Vista?

    Yes and no. You can access the predefined PHP variable $_SERVER['HTTP_USER_AGENT'], but it is populated based on the data supplied by browser, and that data can be spoofed rather easily.

    Thanks guys, I think the $_SERVER[‘HTTP_USER_AGENT’] variable will work for me… I’m new to php (I just know basic syntax) but I think I’ll be able to use it even if I have to google it (=P)

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to detect the OS?’ is closed to new replies.
Skip to toolbar