User login

MetaTraffic 2.0 Boxshot

Easying client-side information tracking.

Posted by Daniel [August 4, 2003]

Good day,

Beside the screen resolution, there are surely other information that could be of some interest, such as the colors, is java enabled, and similar information.

On top of this, I'm planning to track the required time for the server to render a given page, along with the time it took before the body "onload" to trigger, thus giving an indication if the pages are really slow to load, or if in fact this is related to the user's connection.

Some people will say that could be nice, but how can you get the elapsed time resulting from the "onload" stored in the DB, knowing that this value is actually available only when the page finished loading, implying that the tracker already got the other pieces of information stored in the DB ?

The answer is "remote scripting"! Replacing the actual calls to the track.js or the includes of track.asp, by a hidden form with the necessary fields to hold the statistics only available via Javascript, a quick script could be used to post the data when the "onload" events are completed, which in turn will send the data over to the server to be processed by the tracker. The most interesting aspect of this, is that the page will NOT be refreshed by the post, therefore not impacting the display.

Also, doing it this will, will prevent the need to use either the "js" or "asp" approach, knowing that the "extra" statistics will always be available, regardless of type of page, being an ASP or HTM page.

We may lose a couple of entries in the DB if a user clicks on a link before the page gets fully loaded, but this should be minimal.

To ensure database integrity and prevent "collisions", the INSERT done in the PageLog table, could be surround by a BeginTrans and CommitTrans, thus allowing auto-rollback if a transaction fail.

Since the post of the data to be logged will be processed asynchronously, the user will not be impacted by the delay caused by the logger, specially if indexes are added for optimization.

I read quite a few articles on "Remote Scripting" and I think that would be an appropriate approach, wouldn't you ?

Anyone has comments/suggestions/ideas in regards to this item ?

Regards.