I don't trust the average visit duration


I am very new to piwik for a week now and from today on I no longer trust the bounce rate. Neither do I trust the time spent on the site, because the bounce got very high and the time spent on the site got very low. This is not possible - let me explain.

This is all about a simple WordPress blog about developing WordPress. See how Piwik is implemented here: http://wp-includes.com

Why the visit time should be 30-60 seconds

People are talking with me about the content. It is only about 16 people that read a specific page yesterday and I talked with half of them about the content. They need to read this for 30 to 60 seconds for really understanding the content. This is an average time I could understand.

But Piwik shows 3 seconds

Reading the stats for every single user I see that there are many of them with zero visit duration and one with 58 seconds. The average might be calculated correctly but it is impossible that 16 users looked for zero seconds at the page. So I ask myself:

  • What is going wrong here?
  • How can I get reliable data or sort out the one that is wrong?

It kinda depends on how you are implementing Piwik (The site you link to does not exist). Is it just via PHP? Or are you using the JS implementation? How are you sending data to Piwik? In my case I use the JS API as I have a single page application. I implement the async interface in the router.

I took the tracking code Piwik gave me, which is JS.
This goes copy&paste to my website http://wp-includes.org
as you can see in the source.

There is nothing else.

So it looks like you have a JS heavy application. You will probably have to figure out where in the JS to track users as Piwik is obviously not figuring this out for you.

For example, I have a one page application. To track “pages” I need to use the Piwik API. This involves putting this code:

_paq.push(['setDocumentTitle', currentTitle]);

Into my page router.

In your case you are probably going to have to figure out your users (Do they log in somehow?) and then use:

_paq.push(['setUserId', userid]);

on each “page” they navigate to.

I don’t get it. The site I have does not much JS for its own logic. There are normal links to other pages with their own document title and so on.

Where do you see that is is heavily JS?

Besides you wrote these lines:

_paq.push(['setDocumentTitle', currentTitle]);

Every page is its own request and have their own titles.

Do I really have to set the title?

And the last: I will do so, sure. And I wonder if this eliminates the failing record of visit time.

Can you explain me how the title or userId fixes this problem?

Thanks for your help!

Where do I see heavy JS? I did a view source on the page.

The trackPageView command tells Piwik that something has happened and to log it. By separating users out by a specific user ID you can track users better. This way you know which users are using what pages rather than the Piwik code having to guess (Which, in your case, it appears to guess wrong).

Thank you. I will try that and hope that this will correct the zero visit time. Might take a day or week until I find out :wink: