/ Devious Visitor Monitor

Counters are great, but all they tell you is the number of people who have visited your page. This script is designed to automatically trigger an email to be sent to the webmaster including the following information:

  • the visitor's email address (because you can look who the email if from) 
  • the referrer URL (The URL of the page that they clicked a link to get to your page. Referrer is blank if they used a bookmark.) 
  • info about their browser (version, etc...) 
  • info about their computer 
  • the time it took to load the page 
Below is a sample email like the one you the webmaster would receive from every visit. 
-------------------------------------
  To: youremailaddress@somewhere.com
From: visitoremailaddress@nowhere.com
-------------------------------------

PAGE=Devious Visitor Monitor
REFERRER=http://www.yahoo.com/search?key=your+page+info
PLATFORM=Netscape 3.01 (Macintosh; I; PPC)
LOADING_TIME=2.242 seconds
SUBMITTER=Click me to let me know you were here
There are a couple of catches though. This script will only fully work in browsers with JavaScript 1.1 or better (that is, Netscape 3.0+ and MSIE 3.01 Mac or MSIE 4.0 PC). Some older MSIE browsers will pop up an email window instead of just sending the email. Other non-JavaScript browsers like the AOL browser and the WebTV browser will send you an email if the visitor clicks the button. But all the categories will say "none" because they don't have JavaScript. But you can still get their email address from the email.

If you have CGI privileges on your web space and want to be a little less devious but more robust, try our Capture Info Script which will grab any information you want and write it to a log file on the server. But this script can't capture their email because it does not use an email like this Devious Visitor Monitor script.

That brings us to the point of the button. Unfortunately (or fortunately... depending on how you look at it), Netscape has blocked direct form.submit() calls to mailto forms. I guess they are trying to prevent truly "devious" visitor monitors. But we seem to have found a workaround. If we call the button.click() method to submit the form instead of the form.submit() method, Netscape doesn't catch our "devious" trick. So for everyone who is wondering, "Does the button have to be there?", the answer is "YES". Now you can change the name from "Click me to let me know you were here" to " " or whatever you want to make it more inconspicuous. But we chose to leave the long name because we figured it would prompt non-JavaScript visitors to click the button (because you will not otherwise get an email from them).

The final question that you all may be asking is this: "Why does my browser warn me? This script is not truly devious!". You have the option of configuring your browser to warn you when a form is submitted. Every individual browser will have to turn it off by themselves. We can't do it for them. So the browser might show a warning message, but most of the time they will probably just click OK not knowing what is going on.

So if you can deal with having to have a button on your page and with possibly warning the visitor, then this script will work for you. 

 
GRAB THE SCRIPT: The link below is a text document of the code for this script. If you right click on it (click and hold down on Macs), you will get a menu that will let you save the document to your hard drive. Or you can just follow the link and copy and paste the code that your browser displays.

Grab the code for this script: devmon.txt and rename the file devmon.htm (or yourfilename.htm).