Logging with Javascript

wxdqz

New Member
Hello,

I want to create a mini version of a logging tool as done by coremetrics or indextools.

what they do is place a 1 x 1 pixel image on each of your pages with a combinination of javascript and the image is hosted on their servers. so when someone browses your page, their image is "hit" as well and they can get the same information that the server logs get. you can also pass certain paramaters in with the image as well to get even more detailed logging stats.

the downside of a service like this is that the image is hosted by a third party and their are privacy issues. As well as if the image doesn't load up, then the whole page can sometimes get stalled. so i'd prefer to create my own version that is hosted on my own server.

so if anyone can help me get this started, the points i need to find out are:

1) a starting point for setting cookies to track the user. the trick is i would also need to place the image on a different server to track the same user. (the product pages and the shopping cart are on 2 different servers). so the javascript needs to be able to track users going over different servers. plus any pecularities about users with cookies disabled.

2) passing custom paramaters (i.e. product id, order id, page name, etc...) in with the image. upon research it seems this maybe done with just passing paramaters in with the image name like a GET routine. img src = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"pixel.gif?pagename=bluewidget&customerid=abc"


when the data is passed in, i can later parse the logs and search for the pixel gif and the paramaters to come up with the stats.

thanks.
 
Back
Top