Source code of logging visitor's action
Web Access Recorder Logs the Action of the website's visitors by using techique called the JSONP. By using JSONP, you can send data to the server where the domain is different.
- Logger's source code
- Server side program
The logger's source code is in th folder below.
- Initialize access and write cookie.
- Flush it periodically.
After the callback functions for the events registerd, the function for the "onload" event fired at first.
This function gathers information about this access, and sent it by using JSONP. The jsonp() function is one to do it.
JSONP is technique to access server in the external domain, and send information.
In this script, it does
- Check the script tag for JSONP and delete it if exsits
- Create script tag dynamically
This program uses JSONP many times, so it has to delete the script tag used before.
At the first access, it request to atchive the page in the backbround. By using parallel block, it runs in the background simultaneously. About the archiver's source code, please take a look at Archive web page.
Next, call the
This function checks the "user_id" and "access_id". The "user_id" is identifier of user, and the "access_id" is of page access. After check them, insert access record into the "wic_user_page_access" table.
After this function returned, load Jacascript file, which is
if the "cmd" parameter is "sendClicked", "sendScrolled", "sendMouseMoved", or "sendWindowResized", it insert the log into the database.