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?
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.
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.
- The topic ‘How to detect the OS?’ is closed to new replies.