Ignoring web browsers previews

Hi !

I created this topic because preview issues are not only for Google, but for Safari and Opera, and other browsers too.

You know, there’s now special homepages with link to your most visited pages to go fast to them. And this displays a preview of the website.
And this preview is loaded very often (like several times a day, because it works just like RSS, it looks for new content to inform the user that it’s useful to visit the site (which is a cool feature).
But it’s also a problem for analytics : I have (for a small site) 93 visitors, 375 visits, and 80% of 0-30 sec visits for May… So I can’t really trust those analytics ! And in the Live plugin, i always see “Safari”… The same user, a friend of mine that has my site on this special Safari page. This is a huge problem, because i can not exclude this IP, according to the fact that it’s a real computer, and there’s a potential real visitor behind it. What can i do ?
Could there be any possibility of excluding 0-5 seconds visits ?

(Sorry for my rude english.)

What is the user agent used for these previews? can you look in your database, piwik_log_visit for the user agent used?

I don’t find any informations in the database about the user agent. I just don’t know in which field searching.

But in Piwik, it’s just like it was the usual user : there’s nothing different : For the case i’m talking about (a person I know she has my website in this special home page) it indicates Firefox, on a mac, returning visitor for a 0 sec visit several times a day. I’ve got an IP and a provider… Just doesn’t look like a bot or something. It’s truly the browser that loads the page to get a preview…

Sorry, we do not actually store the user agent in the DB, my bad!

The solution to this problem would be for Piwik to exclude all traffic of this “preview” feature. The problem is that we need to know which visits are preview and which are normal. So, maybe the user agent has this information? If not, then piwik cant exclude these visits unfortunately

I truly think the user agent is the very same as the one for standard visits, according to the fact that it is the same browser you’re using to browse the web that gets those previews.
But, according to the fact that those visits are 0 seconds long, I was thinking of an option to exclude the 0 seconds visits from the data… Not permanently, but as a cosmetic option (datas are still collected, but we can display with or without those 0 seconds visits).
Do you think that would be possible ?

what’s the news about this topic?
i have the same problem with a mac user and piwik 1.8.2.

Normally now the Piwik javascript code should try to execute only when itis not a preview - is the code not working for you?

i don’t no.
this is my tracking code:

<!-- Piwik -->
	<script type="text/javascript">
	var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.website.de/" : "http://piwik.website.de/");
	document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
	</script><script type="text/javascript">
	try {
	var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 3);
	piwikTracker.setDocumentTitle("<?php echo($title); ?>");
	} catch( err ) {}
	</script><noscript><p><img src="http://piwik.website.de/piwik.php?idsite=3" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->

the result is attached.

i can not verify thes phenomenon because i don’t have a mac.
me be i can try it with safari for win? i want to try it and i’ll be in touch.

i have to try to reproduce this problem.
but i have no success. i use safari 5.1 on win. visit the website and piwik count it. i restart safari and browse in my bookmarks. i thought safari reload the website. now, i guess it load a screenshort.
maybe it is a bug in an old safari on mac?
this problem i have with a user he use safari 5.0 on mac.

i’m stumped.

it is not a big problem, but it destroy my web analysis :frowning:

Are you using the latest version of Piwik?

Are you using the latest version of Piwik?[/quote]

yes, i use 1.8.2

Do we want to do this in core, or as an optional plugin?

We just need to exclude visits with the X-Moz: prefetch (Mozilla), X-Purpose: preview (Safari, Opera), and X-Purpose: instant (Chrome)

so, isn’t not implementiert?

Piwik 1.8.2 already has support for the Page Visibility API (in piwik.js). Safari’s “Top Sites” obviously changes things, so to exclude these previews, we would need a server-side filter.

Yes we definitely need to exclude all visits with these headers! Thanks Anthon for the tip I didn’t know about these.

I created a ticket: Ignore Web browsers "Preview" http request · Issue #3285 · matomo-org/matomo · GitHub

I guess it’s safe to add it in the Core even though they’re not supposed to happen.

Now fixed in trunk!

Now fixed in trunk![/quote]

yeehhh thx.

It is now released in 1.8.3 beta which you can use already if you wish, info at: 301 Moved Permanently