4

when the visitor goes to a webpage, how do we know the visitor is actually showing the page on top (instead of going to another tab or app already).

also how do we know how long the user has read the page or how long the page stayed open?

nonopolarity
  • 146,324
  • 131
  • 460
  • 740

9 Answers9

11

Google analytics is the best free analytics AFAIK. It shows you all you need.

Shoban
  • 22,920
  • 8
  • 63
  • 107
5

Apart from GA,if you want detailed analytics to analyze how people browse your pages, how menus are traversed, areas users tend to focus and all things UED related like mouse heatmap, time spend etc , ClickTale is the one for you.

Understand that Google Analytics and ClickTale serve radically different purposes. The latter is for the frontend engineer and the other for the SEO or Product Manager

Preview from their blog:
alt text
(source: clicktale.com)

Comes with a price though...

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Cherian
  • 19,107
  • 12
  • 55
  • 69
  • 1
    Holy ****. Time to write a Greasemonkey script to filter out any website which uses this. – Aaron Digulla May 28 '09 at 07:31
  • @Aaron, upvoted even though the tech seems very cool, but for debugging purposes on knowing and willing subjects only. – Kris May 28 '09 at 08:56
  • Why does it matter if a website tracks what parts of the page you interact with most? – Ian Aug 19 '09 at 19:41
5

Install a camera and time the video. :)

<rant>Frankly, why do you need to know? How long it takes me to understand what you write? How long I went to lunch? Is total surveillance of your visitors a Good Thing(tm)?

I already gave you my IP address and the fact that I did visit your page. Is the size and color of my underwear really that important?

As a web surfer, I hate web bugs, data collecting JavaScript and any kind of surveillance in general. If I don't want to give something to you, then don't try to steal it from me.

People all around the globe begin to understand how precious and endangered their privacy is. Criminals come up with more cunning and more devious ideas to abuse data that someone collected. Websites start to fall apart when I visit them without JavaScript. NoScript tells me "jdhsdg.com" wants to run some stuff in my browser. What should I do? Allow? Deny? What happened to good old honesty? What do the marketing guys have to hide that they use names like that?</rant>

[EDIT]

If you need to know whether your site is bad, call in people from the street and watch them (hence "Install a camera"). This way, you can ask them what they think, instead of guessing by watching what their mouse pointer does. Maybe their pet is playing with it?

Don't do this in the wild with unsuspecting victims. That will only make them mad when they find out and in the Internet, your reputation is the only thing with value.

[EDIT2] To improve a web site, use a usability lab. Guesswork with second-level artificial data, which has no fixed relation to what you want to measure, will deceive you. You can't tell what people on earth do by watching the lights during the night from the moon.

At least not unless you pull in lots of data. Google is able to tell what people are interested in by collecting huge amounts of data and search it for patterns. They do attach tokens to browsers to track what an individual does but for the analysis, they join the patterns of millions of individuals.

Also always remember that this data might be valuable to a criminal. The more valuable your data, the more energy they will invest in finding a way to make money from it. They could crack your famous site to distribute viruses, they could crack your server to encrypt your data and blackmail you for ransom, they could copy the data and sell it to a competitor, or they might use it for one of their own schemes.

The various criminal organizations around the globe make billions every year with Internet related crime.

From my point of you, you should really ask yourself: How much is this data worth? How accurate can it ever be? How much will it tell me and how risky is it to collect? How easy is it to fool my scheme? For example, I could create a script which hammers your service, telling it that I'm actively reading some of your pages for hours. Or I could disable JavaScript for your site, see that it doesn't work, and simply walk away, never coming back.

So far, you only asked what's in for you. Start thinking what's in for your customers and about the worst case scenarios.

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • 2
    it can help too... such as improving pages that users quickly exit. – nonopolarity May 28 '09 at 07:17
  • 2
    If you can't measure a system you can't improve it. Analytics is a must on any non trivial system, web or otherwise. – ilivewithian May 28 '09 at 07:26
  • @Jian Lin: if you need to know whether your site is bad, call in people from the street and watch them (hence "Install a camera"). Don't do this in the wild with unsuspecting victims. That will only make them mad when they find out. – Aaron Digulla May 28 '09 at 07:27
  • @ilivewithian: AFAIK, I can disable Analytics without adverse effects, so I can live with that. Incidentally, Analytics is disabled in my firewall and all my web browsers. My data is mine. You want it, you pay for it. – Aaron Digulla May 28 '09 at 07:33
  • @Aaron so if a company looks at the web log and see that people like to visit webpages of a certain topic, and add more content about that topic, that invades your privacy too? How about if a company found that more and more people use Firefox and decide to make better support for Firefox? Do you feel it invades your privacy too? – nonopolarity May 28 '09 at 08:06
  • @Jian Lin: When I visit a site, I know what I'm giving them: My (obfuscated) browser id and my IP address (or rather the one of my proxy). That's what they got and there is little I can do to prevent them to abuse this information in ways I can't think of. Everything else goes into the "gray" zone. The more you collect, the more people will hate you, no matter your intentions (see Google). So be careful. You can ruin your reputation only once. :) – Aaron Digulla May 28 '09 at 08:28
  • Rule of thumb: Data that isn't collected can't be abused. Data that is collected will eventually be abused. As always, reality beats paper. – Aaron Digulla May 28 '09 at 08:30
  • @Jian Lin: One more thing: If you sell to people from Germany, some courts consider the IP address private data of the customer and rule it to be illegal to peek at it (they judged this the same as secretly opening letters in a post office). Counting visits is OK, but not identifying individuals. Others courts have ruled differently, though. – Aaron Digulla May 28 '09 at 08:34
  • Outside of the "wanting to know what needs improvement on the site" issue... It costs time and money to create and support a web site. Ads are a common way to generate that money. Being able to provide potential ad clients with numbers (unique users, return visits, time spend on pages) means you can better market your pages. – RHSeeger May 28 '09 at 15:28
2

I use woopra for some time now at it is just great! Still beta and still free but works like a dream. Great managment tool!

http://www.woopra.com/

TalkingCode
  • 13,407
  • 27
  • 102
  • 147
2

Open Source Google Analytics alternative: Piwik. Written in PHP, JS; runs on MySQL.

From their site:

Piwik is a downloadable, open source (GPL licensed) 
web analytics software program. 
It provides you with detailed reports on your website visitors: 
the search engines and keywords they used, 
the language they speak, your popular pages ...
miku
  • 181,842
  • 47
  • 306
  • 310
1

On page load, save the current time in JavaScript, and on page unload (when the user closes his/her window) send an Ajax request to your server with the time minus the time that you recorded to get the duration. That would probably be your best bet. As for finding out if the window is on top, I don't think there is any reliable way of doing that.

Sasha Chedygov
  • 127,549
  • 26
  • 102
  • 115
0

Here is a JavaScript library that times how long a user is on a web page. It has the added benefit of more accurately (not perfectly, though) tracking how long a user is actually interacting with the page. It ignores time that a user switches to different tabs, goes idle, minimizes the browser, etc. The Google Analytics method suggested has the shortcoming (as I understand it) that it only checks when a new request is handled by your domain. It compares the previous request time against the new request time, and calls that the 'time spent on your web page'. It doesn't actually know if someone is viewing your page, has minimized the browser, has switched tabs to 3 different web pages since last loading your page, etc.

No solution is perfect. But hopefully this one provides value, too.

https://github.com/jasonzissman/TimeMe.js

An example of its usage:

On loading your page:

document.onload = function() {
  TimeMe.setIdleDurationInSeconds(30);
  TimeMe.setCurrentPageName("my-home-page");
  TimeMe.initialize();  
}

Retrieving time spent on the page, and sending it to your server when the user leaves your page:

window.onbeforeunload = function (event) {
    xmlhttp=new XMLHttpRequest();
    xmlhttp.open("POST","ENTER_URL_HERE",false);
    xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    var timeSpentOnPage = TimeMe.getTimeOnCurrentPageInSeconds();
    xmlhttp.send(timeSpentOnPage);
};
jason.zissman
  • 2,750
  • 2
  • 19
  • 24
0

i was thinking whether some websites use onmousemove or onscroll to call a function, and then every 1 minute, report the user activities back to the server using AJAX.

nonopolarity
  • 146,324
  • 131
  • 460
  • 740
0

That's a good point Aaron. You can't avoid the web from becoming like the real world...intrusive (commercial phone calls and others statistic stuff)

Jian, you may be able to know such a thing by calling a timer each 4 or 5 seconds which calls a dynamic page with post or get fields that contain the guest IP, the page name, and the timestamp of the page onload event, and compare it to right now.

You also should have a look at push methods like comet
ajaxian.com/wp-content/images/comet.png

William Huart
  • 23
  • 1
  • 6