There is a way to exclude URL Query parameters, but I couldn't find anything to exclude folders.
I would find it useful to be able to exclude a list of folders like /admin, etc.
Why don't you exlude those folders by not including the tracking there?
I thought about that, but it's not always easily feasible.
Let's say you're using a CMS and you don't want to track each time somebody goes to login/index.html.
You would have to write some code excluding the code to appear on certain URLs instead of just pasting the piwik code into the template.
Also, a user would find it convenient to filter folders from the Piwik interface because he realizes that some don't provide valuable info.
Excluding a parameter is different from excluding a path. The former still tracks the pageview and visit. The latter (as I understand it) asks that we exclude the pageview but presumably still track the visit.
Instead of excluding the pageview in the tracker, would a datatable filter work for you?
I would only track the visit if the visitor has at least one pageview outside of the excluded paths.
What about implementing a function in piwik.js to define those paths and then only track pageviews that are not within the excluded paths.
I agree with SteveG.
That would prevent some uninteresting visits from polluting the rest of the stats, but we would still track the visitors for all the other pages/folders
In that case, let's mark this as a wontfix. Adding a new method to piwik.js which simply acts as a wrapper for a one-liner seems silly, especially considering that we'd have to also have document it and add unit tests.
To exclude a pageview:
if (!window.location.pathname.match(/^\/(admin|login)\//)) tracker.trackPageView();
You mean, adding this to the code on the pages to track?
yes. the advantage of doing it on the client is that there's no tracking data sent to the server, nor wasted cycles on the server to process something that you're not going to record anyways.
Sounds good to me.
Should be added to the faq :)
I added the FAQ on http://piwik.org/faq/how-to/#faq_89
let me know if the text can/should be improved, thanks!
There is no FAQ #89 on that page. Hasn't been published yet?
It should be now, thx
Well done. Thank you :)