Jump to content

Web stats/analytics - user threads


pdavis2

Recommended Posts

Hello,

we're a governmental agency planning a redesign. As such, we don't have a use for analytics designed to track ads and revenue streams. Our user universe is relatively small, and consists of a number of repeat users (daily, weekly or better).

What we're looking for:

1) what our users look at and making those items easier to find, and

2) what I call user threads; that is, when a user looks at multiple pages/items,

how do we track that?

For instance, some of our users are attorneys. They may look at opinions, rules, announcements and/or forms. I'm currently looking at Crazy Egg and Google Analytics, but mostly these deal with subjects that we're not particularly interested in.

Is there statistics/analytics apps out there that will allow us to track individual user experience through their site visit(s)? (I.e., first they look at this, then they look at that or that, then they look at this other thing, etc...)

Link to comment
Share on other sites

I created my own stats with php & mysql

 

Create a mysql database with feilds:

 

id, ip, referer, browser, date, time, page

 

id being primary key and auto number.

 

Add this code to the top of each page you want to track:

(make sure that you have already made a database connection).

 

<?php

// record stats

$ip = $_SERVER['REMOTE_ADDR'];

$referer = $_SERVER['HTTP_REFERER'];

$browser = $_SERVER['HTTP_USER_AGENT'];

$date = date("Y/m/d");

$time = date("H:i:s");

$page = $_SERVER['PHP_SELF'];

mysql_query("INSERT INTO `stats` (ip, referer, browser, date, time, page) VALUES ('$ip', '$referer', '$browser', '$date', '$time', '$page')");

// end of stats

?>

 

ip will give their ip address so you can track induvidual users.

 

referer will show you which page they came from, this will also show you search queries in google etc..

 

browser shows browser info, you can use this to identify search engine bots from users.

 

page is the page they are viewing.

Edited by sjhwebdesign
Link to comment
Share on other sites

Interesting stuff, although the Woopra product is in beta and our numbers are a bit higher than they want. (I also didn't see anything that struck me as exactly what I'm looking for - am I using the wrong vernacular?)

 

The PHP stuff is great too! I'll share that with my tech colleague to see if it can be implemented.

 

Thanks to both respondents!

 

Still looking for other possible solutions, although right now am plowing through some google analytics content to see what they're up to. I'll report on it if I find anything of interest. Any particular questions about it I might check on?

 

Best wishes to all.

 

PD

Link to comment
Share on other sites

the good thing about the php is its your database, no one else has access.

 

i looked at the woopra site, seems you have to have an account with them which means the info will be stored on their server, you will add some java script to each page that will do what the php does but will send the info to them, you will log in to view the info, what else will they do with the info though.

Link to comment
Share on other sites

use this code to create a basic display of the stats;

 

(you will have to make mysql connection before the code).

 

(there is some code to identify certain bots, works but needs some work).

 

<?php

$date = date("Y/m/d");

$getstats = mysql_query("SELECT * FROM stats ORDER BY date DESC, time DESC LIMIT 100");

$getdailyvisits = mysql_query("SELECT * FROM stats WHERE date = '$date'");

$gettotalvisits = mysql_query("SELECT * FROM stats");

$dailyvisits = mysql_num_rows($getdailyvisits);

$totalvisits = mysql_num_rows($gettotalvisits);

?>

SITE STATS:


PAGE VIEWS TODAY: <? echo $dailyvisits; ?> TOTAL PAGE VIEWS: <? echo $totalvisits; ?>

IP

PAGE VIEWED

DATE

TIME

REFERER

SPIDER

BROWSER

<?php

while ($stats = mysql_fetch_array($getstats)) {

?>

<? echo $stats['ip']; ?>

<? echo $stats['page']; ?>

<? echo $stats['date']; ?>

<? echo $stats['time']; ?>

<? echo $stats['referer']; ?>

<?php

$info = $stats['browser'];

//msncheck

$match = false;

$string_to_match = "msnbot/1.1 (+http://search.msn.com/msnbot.htm)";

if(strpos($string_to_match, rtrim($info)) !== false)

{

$match = true;

}

if($match == true)

{

?>

MSN BOT

<?

}

// end msncheck

//yahoocheck

$match = false;

$string_to_match = "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)\";

if(strpos($string_to_match, rtrim($info)) !== false)

{

$match = true;

}

if($match == true)

{

?>

YAHOO SLURP

<?

}

// end msnyahoocheck

?>

<? echo $stats['browser']; ?>

<?php

}

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...