@oparoz opened this Issue on October 3rd 2010

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.

@sgiehl commented on October 3rd 2010 Member

Why don't you exlude those folders by not including the tracking there?

@oparoz commented on October 3rd 2010

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.

@robocoder commented on October 3rd 2010 Contributor

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?

@sgiehl commented on October 3rd 2010 Member

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.

@oparoz commented on October 3rd 2010

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

@robocoder commented on October 3rd 2010 Contributor

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();
@oparoz commented on October 3rd 2010

You mean, adding this to the code on the pages to track?

@robocoder commented on October 3rd 2010 Contributor

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.

@oparoz commented on October 3rd 2010

Sounds good to me.
Should be added to the faq :)

@mattab commented on November 16th 2010 Member

I added the FAQ on http://piwik.org/faq/how-to/#faq_89

let me know if the text can/should be improved, thanks!

@oparoz commented on November 16th 2010

There is no FAQ #89 on that page. Hasn't been published yet?

@mattab commented on November 16th 2010 Member

It should be now, thx

@oparoz commented on November 16th 2010

Well done. Thank you :)

This Issue was closed on November 16th 2010
Powered by GitHub Issue Mirror