Re-Track each (for example) 30 seconds

[quote=vipsoft]
IIRC, GA fakes it. If you don’t want to see 0, you can change the default setting in config/config.ini.php:


[General]
; treat bounce as a minimum 30 second visit
default_time_one_page_visit = 30

Note: the client-side changes have already been implemented for re-track (ping/heartbeat).[/quote]

This setting has to go under [Tracker] not [General] .

I too am interested in not showing 0 seconds for one page visit and did the change but was wondering why it was not catching my settings of 10 seconds (which comes a bit closer to one page visit :slight_smile: ). So I looked up global.ini.php. And there it is under [Tracker]. Will know more tomorrow.

Hi vipsoft,

even after correct placing the entry under [Tracker] in config.ini.php it is NOT picked up.
Today I changed the setting in global.ini.php and IT IS picked up. At least in my case.

Why, no idea. Just wanted to let you guys know.

So Piwik 1.2 is out and there is no implementation of my assumed enhancemend right!?

Targeted for 1.3. We didn’t implement the server-side changes in time for 1.2.

I built something that does this a while ago because I have a site that primarily has one page on it, and I wanted to see how long they spent there. It turns out to be useful on sites that have many pages as well.

Here is what I did:

I created a directory piwik/refresh
piwik/refresh contains two files piwik/refresh/refresh.js and piwik/refresh/refresh.php

You can get those files here http://port443.net/refresh.zip

I then added javascript to the piwik tracking code on my pages:

Below

[size=small]document.write(unescape("%3Cscript src=’" + pkBaseURL + “piwik.js’ type=‘text/javascript’%3E%3C/script%3E” ));[/size]

I add

[size=small]document.write(unescape("%3Cscript src=’" + pkBaseURL + “refresh/refresh.js’ type=‘text/javascript’%3E%3C/script%3E” ));[/size]

The js file writes an img tag, and has a function that changes the src of that img every 45 seconds to the php file.

The php file reads the piwik cookie and updates the last action time and total visit time for the visit, and outputs a pixel gif.

Please keep in mind that the refresh.php file will not work for you as-is. It does not use piwik’s database connection, I use a different class for db access. If someone wants to modify it to work with piwik’s configuration and db access, please do.

-Kevin

[quote=turbo]
Hi vipsoft,

even after correct placing the entry under [Tracker] in config.ini.php it is NOT picked up.
Today I changed the setting in global.ini.php and IT IS picked up. At least in my case.

Why, no idea. Just wanted to let you guys know.[/quote]

For Piwik 1.2 the above settings in config.php are picked up correctly.

Hey guys, its Piwik 1.4, can you give me an update. Whats up to this topic, implemented or not? How can I use this feature?

For updates on the subject you should consult Support Ping requests to report a better 'time on page' · Issue #2041 · matomo-org/matomo · GitHub

Hello!

Has anyone used this? I tried but it doesn’t seem to write anything to the database? I did setup the DB name, table name, user, pass inside the refresh.php script. Absolutely no idea why it doesn’t work and I’m not that skilled to even think of stuff to test to see where the problem might be. Any ideas?

Thanks!

[quote=TucsonKEG]
I built something that does this a while ago because I have a site that primarily has one page on it, and I wanted to see how long they spent there. It turns out to be useful on sites that have many pages as well.

Here is what I did:

I created a directory piwik/refresh
piwik/refresh contains two files piwik/refresh/refresh.js and piwik/refresh/refresh.php

You can get those files here http://port443.net/refresh.zip

I then added javascript to the piwik tracking code on my pages:

Below

[size=small]document.write(unescape("%3Cscript src=’" + pkBaseURL + “piwik.js’ type=‘text/javascript’%3E%3C/script%3E” ));[/size]

I add

[size=small]document.write(unescape("%3Cscript src=’" + pkBaseURL + “refresh/refresh.js’ type=‘text/javascript’%3E%3C/script%3E” ));[/size]

The js file writes an img tag, and has a function that changes the src of that img every 45 seconds to the php file.

The php file reads the piwik cookie and updates the last action time and total visit time for the visit, and outputs a pixel gif.

Please keep in mind that the refresh.php file will not work for you as-is. It does not use piwik’s database connection, I use a different class for db access. If someone wants to modify it to work with piwik’s configuration and db access, please do.

-Kevin[/quote]

[quote=medyum]
Targeted for 1.3. We didn’t implement the server-side changes in time for 1.2. medyum[/quote]

Thank you very much! Where could one see the expected release date for 1.3?

BTW: Just noticed the current version is 1.5.1 as of today?

Thanks

Just wanted to bump this in the feature suggestions forum.

It’s scheduled for 1.10 right now!

[quote=“Fabian Becker”]

It’s scheduled for 1.10 right now![/quote]

Awesome to hear this! …and I AM!!! very grateful to you guys for such an amazing work!!! Thanks!

has it been implemented?
Bounce pages are still shown as 0 seconds.(Piwik 2.4.1.)

Also, piwik rocks, 100% better,than GA.

Has this feature been implemented now?

I get a lot of single page views and they all report back as 0s! NOT GOOD and ultimately paints an unhelpful analytical report.

I have read through all the other forum posts about why this is the case and why things like a setHeartBeatTimer are difficult to implement…

But this was all a really long time ago. Please advise whether there are any new fixes/mods to improve on this.

Many thanks.

Hi there, pleae comment on the issue directly, we really need to schedule this one and it helps that users like you remind us! Support Ping requests to report a better 'time on page' · Issue #2041 · matomo-org/piwik · GitHub

Good news! Starting in Piwik 2.14.0 the new feature of tracking how long users stay on page (using a Heart beat timer “ping” request) has been released. You can enable it with


_paq.push(['enableHeartBeatTimer']);

By default, a ping request will be sent every 15 seconds. You can specify a custom ping delay (in seconds) by passing an argument, eg,


_paq.push(['enableHeartBeatTimer', 10]);

Learn more in the Tracking JavaScript guide: JavaScript Tracking Client: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

Update today to enjoy this new feature (as well as many other improvements!)

Hello,
I have single page application with piwik as tracking system.
Here is my code:


<script type="text/javascript">
            var _paq = _paq || [];
            _paq.push(['trackPageView']);
            _paq.push(['enableLinkTracking']);
            _paq.push(['enableHeartBeatTimer', 10]);
            (function () {
                var u = "//{ip}/piwik/";
                _paq.push(['setTrackerUrl', u + 'piwik.php']);
                _paq.push(['setSiteId', 1]);
                var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
                g.type = 'text/javascript';
                g.async = true;
                g.defer = true;
                g.src = u + 'piwik.js';
                s.parentNode.insertBefore(g, s);
            })();
        </script>

The problem is in the time spent on concrete page.
For each page we have:


_paq.push(['setDocumentTitle', '{title}']);
_paq.push(['trackPageView']);

And it is tracked perfectly, but not the time. It always shows wrong value.
I could spend 3+ minutes on one page but the dashboard shows me either 00:00:00 or something like 00:00:01 which is not correct.
I see that ping requests are performed.

What can be wrong here? What information else should I provide?
Thank you in advance.

Can anybody help me?
Maybe I need to add some specific param?

Also I’ve tested on localhost with latest code - time is calculated wrongly! With HeartBeat enabled and disabled.

Not so good ((((

Check out this new FAQ: How do I accurately measure the time spent by visitors on my pages, including the time spent on the last page of their visit?

Heartbeat should work perfectly fine in the last Piwik version. if you have any issue please create a bug report on : Issues · matomo-org/piwik · GitHub