S
S
shaida2011-03-21 00:26:33
Analytics
shaida, 2011-03-21 00:26:33

The time the user spends on the site

Are there statistics services that correctly read this information?
None of the services I know can take into account the time of those who had a single view.

Answer the question

In order to leave comments, you need to log in

9 answer(s)
M
mambet, 2011-03-21
@mambet

It is impossible to calculate this time completely correctly (unless you send data to the server about all the movements and clicks of the user on the page - and not just about those that initiate some kind of communication with the server).
You can calculate a little more correctly by analyzing all client requests to the server yourself. Let's say the user opened the signup form at 10:00. We know that it takes an average of 2 minutes to fill it out. At 10.10 the user clicked on "Register". Most likely, he actually spent about two minutes on the site (distracted by something else) than all ten minutes.
In theory, by compiling a table where the average time of working with a particular page / action will be written + analyzing the logs, you can more or less correctly calculate the time a person works on the site.
In one of the projects to which I am related, we count the time using a similar algorithm, however, our plate is rather simplified. But we need to know the time only approximately.
But maybe there are online services that can do this. Maybe someone else can advise.

S
sajgak, 2011-03-21
@sajgak

Most likely you will have to pervert yourself a little for this. because the only way to verify such "single views" is to constantly poll the user. Accordingly, the simplest implementation is to send a request to the server via ajax once every N seconds. And there inside it will already be considered which page by which user how much it looked with an error of those same N seconds.
Of course, it is difficult to imagine what it will be with good attendance, but if there is a task, there is its implementation)

G
gadzhi15, 2011-03-21
@gadzhi15

Look in the direction of Yandex metrics, it seems there was something similar.

J
javenue, 2011-03-21
@javenue

There was an idea, but I don’t know how it works, since I have never done this.
After all, time can be counted on the client using javascript and, in necessary situations (for example, following an external link), it can already be sent by Ajax to the server. You just need to hang appropriate handlers on all external links. Well, track when a person simply enters a different URL in the browser line and leaves the site. As far as I know, both can be implemented.

P
philpirj, 2011-03-21
@philpirj

Look also here .

R
RomAndry, 2011-03-21
@RomAndry

And also read this

S
Shvonder, 2011-03-21
@Shvonder

If I were paranoid and wanted to track the time spent on the site as accurately as possible, I would do this:
1. The client connected. We mark the time.
2. On the client side, we open a permanent connection with JavaScript (comet, long-polling, etc.)
3. If the client went to another page, we take into account the time (the time spent viewing that page and the total time on the site) and go to step 1
4. If the visitor hasn't moved the mouse, or hasn't scrolled the page for the Nth time, the javascript terminates the connection.
5. If the client disconnected and did not reconnect within 10 seconds, then it means that he closed the tab or item 4 worked, or he left the tab active and went to drink tea. Stop counting time

M
Mikhail Lyalin, 2011-03-22
@mr_jok

M.b. It is worth clarifying - why is this even necessary?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question