Time Spent on Page | JavaScriptSource

Time Spent on Page

Cody Shaffer Mar 22, 2006
This script displays an alert message when a page is closed, telling the visitor how long (in seconds) they have been on the page. It can also display the time on the page in the title bar.

The JavaScript Source: Time & Date : Time Spent on Page

Simply click inside the window below, use your cursor to highlight the script, and copy [Control]+C the script into a new file in your text editor (such as Note Pad) and save [Control+S]. The script is yours!!!

Did you use this script?  Do you like this site?  Please link to us!

Leave a Response


Hello, I have copy all script as you explained, but where can I see the result now? Please, help.

Arbnor Mar 1, 2017

Excellent Code. Will be useful to build Analytics module like Google.

Ravi Mar 5, 2013