Gentoo Archives: gentoo-user

From: daniel <danstemporaryaccount@×××××.ca>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] recomendations for web stats in php
Date: Mon, 08 Aug 2005 17:37:21
Message-Id: 200508081336.27041.danstemporaryaccount@yahoo.ca
In Reply to: Re: [gentoo-user] [OT] recomendations for web stats in php by "A. Khattri"
1 you might want to check out awstats (emerge awstats) it's a very in-depth
2 apache log analyser that'll parse combined-formated log files to capture all
3 sorts of handy information and graph it to be pretty too ;-)
4
5 barring that, you could write your own php (or whatever language you like)
6 -based script to handle pixel calls. something like this:
7
8 the page you track includes html display of a pixel. the img call for the
9 pixel looks like this:
10
11 <img
12 src="/pixel.php?name1=value&name2=value"
13 width="1"
14 height="1"
15 alt="tracking pixel"
16 />
17
18 you can use your own code (even javascript if you wanna capture neat stuff
19 like client resolution and colour depth) and pass that in the query string to
20 your tracking server. your tracking code will look something like this:
21
22 <?
23 // capture query string data
24 foreach ($_GET as $name => $value) {
25 // do some logging of some kind
26 }
27 header('Content-type: image/gif');
28 header('P3P: CP="NOI NID ADMa OUR IND UNI COM NAV"');
29 header('Expires: Sat, 22 Apr 1978 02:19:00 GMT');
30 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
31 header('Cache-Control: no-store, no-cache, must-revalidate');
32 header('Cache-Control: post-check=0, pre-check=0', false);
33 header('Pragma: no-cache');
34 printf(
35
36 '%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%',
37
38 71,73,70,56,57,97,1,0,1,0,128,255,0,192,192,192,0,0,0,33,249,4,1,0,0,0,0,44,0,0,0,0,1,0,1,0,0,2,2,68,1,0,59
39 );
40 ?>
41
42 that'll output a transparent gif and make sure that it's not cached so you can
43 continue to log repeated page calls.
44
45 hope that helps ;-)
46
47
48 --
49 keep away from people who belittle your ambitions. small people always do
50 that, but the really great make you feel that you too can become great.
51 - mark twain
52 --
53 gentoo-user@g.o mailing list