You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Matthew Webster <eu...@freeuk.com> on 2002/12/10 19:32:01 UTC

[users@httpd] User tracking via logging

Hi,

I'm trying to get individual user tracking using cookies (don't like 
the idea of url re-writing for this project) but I can't seem to 
identify an individual browser session, which is what cookies, I 
thought, are supposed to provide (mostly).

I have in my virtual host:

LoadModule usertrack_module modules/mod_usertrack.soServerName .
mydomain.com
CookieDomain .mydomain.com
#CookieExpires "1 weeks"
#CookieName mycookie
CookieStyle Cookie2
CookieTracking on
CustomLog "C:/WebSite/clickstream.log" "%{cookie}n %r %t"

And was expecting to get a unique identifier with each browser session 
which I could use to track a n individual's movements through my site 
over a number of visits.  However, the typical output in my clickstream.
log is:

80.192.223.164.1039544782255073 GET /page1.shtml HTTP/1.1 [10/Dec/2002:
18:26:22 +0000]
80.192.223.164.1039544782705721 GET /page2.shtml HTTP/1.1 [10/Dec/2002:
18:26:22 +0000]

etc.etc.  This is not particularly helpful because I would like to be 
able to write a script or some such thing which will break the log down 
and allow me to see the path each user individually has taken through 
my site.

Could anyone tell me where I've gone wrong and what I might do to get 
the desired result please?      I'd like to write the script to inspect 
the output myself, as it will be in Java.


Thanks,

Matt.

-- 
Matthew Webster - 07984 164 535
eudoxus@freeuk.com
http://www.eudoxus.freeuk.com/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] User tracking via logging

Posted by Jacob Coby <jc...@listingbook.com>.
> 80.192.223.164.1039544782255073 GET /page1.shtml HTTP/1.1 [10/Dec/2002:
> 18:26:22 +0000]
> 80.192.223.164.1039544782705721 GET /page2.shtml HTTP/1.1 [10/Dec/2002:
> 18:26:22 +0000]
>
> etc.etc.  This is not particularly helpful because I would like to be
> able to write a script or some such thing which will break the log down
> and allow me to see the path each user individually has taken through
> my site.

The format is: "[ip].[pid][request_timestamp][request_usec]"

The idea is to generate a unique cookie per request, not to generate one per
session.  You'll have to define what makes a session (since HTTP is a
stateless protocol) on your own when you parse the clickstream.  Good luck
breaking it apart as it doesn't pad, so the pid could be 2-5 chars, the time
is 10 chars, and the utime is 1-3 chars.

The actual code is (if you can read c):

ap_snprintf(cookiebuf, sizeof(cookiebuf), "%s.%d%ld%d", rname,
                (int) getpid(),
                (long) tv.tv_sec, (int) tv.tv_usec / 1000);

-Jacob


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org