WordPress.org

Ready to get started?Download WordPress

Forums

How to detect the OS? (7 posts)

  1. Vicfred
    Member
    Posted 5 years ago #

    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

  2. Cherriii
    Member
    Posted 5 years ago #

    If you track your blog with Google Analytics, it also tracks the visitors OS for you.

  3. Vicfred
    Member
    Posted 5 years ago #

    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-

  4. Chris_K
    Member
    Posted 5 years ago #

    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/

  5. Cherriii
    Member
    Posted 5 years ago #

    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.

  6. NC@WP
    Member
    Posted 5 years ago #

    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.

  7. Vicfred
    Member
    Posted 5 years ago #

    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)

Topic Closed

This topic has been closed to new replies.

About this Topic