Determine how much time a visitor spent on a webpage

Status
Not open for further replies.
#1
I know that the way things are now Statcounter cannot report on how long a person has visited a page on my website when it is the last page visited or when the page is closed.

However, does anyone know of a way, or some code that can be added to my website pages, so that it can be determined how long someone visited a page before they closed the page or left my website?

Can anyone help me with this or direct me to a site that might be able to help?

Regards,
Art
 

Car Guy

Super Moderator
#2
Once the page has been loaded in the browser their is no more activity that happens that can indicate how long the visitor viewed that page. I could load one page of your site and then leave for the day, or I could just close it as soon as the page has loaded. The browser does not send information back to your site about closing or leaving your page.

The only way to determine visitor length of visit is by having 2 or more page loads.

More about this here: http://forum.statcounter.com/vb/showthread.php?t=38226
 
#3
Thanks for the quick Reply. I know that Statcounter does not have a way to determine how long someone stays on the last webpage viewed. By starting a thread here I was hoping that someone might know of another way, or some code that could be added to my webpages to make such a determination.

Art
 

Car Guy

Super Moderator
#4
It's not possible with the current browsers. Once the page has been sent to the browser, their is no need for the server to do anything more. The server has NO way of knowing what anyone is doing with that page unless they click on a link or perform some similar action, just viewing it isn't enough.

It would take a change on the browser to send a notification that the page has been closed. Good luck convincing the them that is benefits anyone other than web site owners.
 
#5
I guess I’m grasping at straws, but might there be some code that I could add to my webpages to accomplish this? For example, when one of my webpages is closed, a “window.onunload” event (or something similar) could be set to trigger an email to me.

Art
 

Car Guy

Super Moderator
#6
An email sent out every time a webpage is closed! That could mean several hundred emails a day for many people.

It has to be an interaction between the browser and the sever. When no action is taken by either no event can be recorded.

Once the server delivers the page to the browser, it is up to the browser to act if an action is to be recorded. The way the page is handled by the browser would need to change.
 
#7
I only get one or two page hits per day, typically from different visitors, so there is no record of time spent. That is why I'm interested in how long a visitor stays on one of my pages or whether they leave immediately without reading anything. Anyway, thanks for taking the time to explain why what I want cannot be done.

Much appreciated Car Guy.

Regards,
Art
 

Car Guy

Super Moderator
#8
If you split your page, and have a part 2, then you have a better chance at gauging your visitor's visit time, or least get an idea of how many visitors read the whole article.
 
#10
Electrician Manly

The information in the StartCounter is very useful, so we browse through each post. If you provide still more extended data the time of the visitor staying on your site will be more.
 
Last edited by a moderator:
#18
Create Coding like Google Analytics

Best thing to know the time spend by users in any website's page, you can put the code generated by Google analytic on you web pages. If you do not want to put it so just creates the coding for evaluating same with the help the Google Analytic. Its excellent!!
 
#20
Using jQuery code for sending navigation information

I have a long landing page that I wanted to track the user navigation in it.
To accomplish this, I used the <noscript> code of the statcounter in custom.js:


/* =================================
=== STICKY NAV ====
================================= */


$(document).ready(function() {
/*
$('.main-navigation').onePageNav({
scrollThreshold: 0.2, // Adjust if Navigation highlights too early or too late
filter: ':not(.external)',
changeHash: true
});
*/
$('.main-navigation').onePageNav({
currentClass: 'current',
changeHash: true,
scrollSpeed: 1750,
scrollThreshold: 0.5,
filter: '',
easing: 'swing',
begin: false,
end: function() {
//I get fired when the animation is ending
var image = new Image();
image.src = "http://c.statcounter.com/<proj_id>/0/<code>/1/?id=" + window.location.hash.substr(1);
},
scrollChange: function($currentListItem) {
var myHash = $currentListItem[0].firstChild.hash;
var heavyImage = new Image();
heavyImage.src = "http://c.statcounter.com/<proj_id>/0/<code>/1/?id=" + myHash.substr(1);
}
});

});

Seems to work.
I know there is a code when the page is unloaded (as some landing page offer me "special offer" when I try to close the page. In this code another image load can be inserted to get exit indication.

BUT: I do want to get the 'anchor' indication in the statcounter logs. How can I get it?

Thank you,

Michael
 
Status
Not open for further replies.
Top