More Referer Scripts

I like to know some things about the people who visit my site. Most of the people are lurkers and don’t leave comments so I’ve been developing some referer scripts. Some other statistics I’ve started to develop are Browser Agents, Operating Systems, Search Engines and Visitor Locations.

I thought some of these scripts might be useful to other people, so I’m trying to package them up into neat little functions that anybody with MySQL and PHP on their site can use them.

I’ve started writing a “tutorial” of sorts about how to gather information about the people visiting your web site. I just posted “Day 1.” Day 2 may not necessarily follow tomorrow, but it will be coming soon.

10 Responses to “More Referer Scripts”

  1. Jason Says:

    I’ve already seen some people coming from Scriptygoddess.com to my website since Jenn posted this article.

  2. Stu Says:

    Jennifer, Seeing as at least 10% of your visitors are Mac (and probably a lot more that are getting reported as other), I would think you would be interested in recording Safari as an agent. I would guess this would account for most of your other agent.

    Just a thought…

  3. Jennifer Says:

    Jason is the author of that post and script… I’m just the messenger. :) But he is getting comments emailed to him…

  4. Jason Says:

    Stu,

    I’m not leaving Safari out on purpose. I don’t have a Mac myself, so I can’t test to see what the HTTP_USER_AGENT string looks like. If you can tell me that, I’ll add a test for Safari to my script.

    BTW, if anybody is following along, I’ll post the script for displaying browser and os data late tonight or early tomorrow (EDT)

  5. zannie Says:

    I’m not sure if i’m using the same script or not, however, I clicked on the referrer script link, the one by Dean Allen and installed that and it doesn’t seem to jive with pMachine….. specifically the mailing lists portion. Wasn’t sure if that was a known bug - or a bug at all - or something that *I* did wrong, but I just thought I’d report back. :)

  6. Jason Says:

    I’ve posted Day 3 of the Referer Scripts Tutorial.

  7. Stu Says:

    Well 30 seconds of Goolging for HTTP_USER_AGENT safari

    revealed

    http://www.xiven.com/blog.php?start=34&count=1

    Or if you want it immediately:

    elseif(strstr($_SERVER['HTTP_USER_AGENT'],”Safari/”)) {$useragent = ‘Safari’;

  8. Stu Says:

    Also your code for identifying Mac’s might need a little work. Some agents refer to them as PowerPC, not PPC or Mac. Just an extra clause might get you more precise statistics.

  9. Stu Says:

    This web page seems to have a good list of user agents:

    http://www.hofflergroup.com/public/HitCount.xml?summaryField=user_agent

    You can see what you are by doing a refresh, and seeing which count goes up. My Mac OS X with Safari seems to be:
    mozilla/5.0 (macintosh; u; ppc mac os x; en-us) applewebkit/85 (khtml, like gecko) safari/85

  10. chris Says:

    if you are looking for stats on who visits your sites…
    awstats provides alot of information including browser, OS, robot hits… etc…

    awstats.sourceforge.net