Remove visitors of certain pages

Hi!

I searched the forum for a solution but could not find it.

I want to remove automatically all visitors of backend pages of our CMS from beeing counted in the stats.

I thought the best way would be to set the ignore cookie when loading the backend pages. But so far I have not found the way how I could set this cookie automatically when the pages are loaded.

Does somebody know how set the cookie on loading of a page?
Thanks.
Dirk

Hi Dirk,

What software is your CMS and how are you doing your tracking ? Is it a PHP based backend that you have put the primary tracking code in the footer of a shared template maybe. Can you give us an example of the URL pattern you want to exclude ?

Stephen

Take a look at http://piwik.org/faq/how-to/#faq_89 which will show you how to not track specified paths, for example http://www.domain.com/admin/

[quote=IAmNoONESolutions]
Hi Dirk,

What software is your CMS and how are you doing your tracking ? Is it a PHP based backend that you have put the primary tracking code in the footer of a shared template maybe. Can you give us an example of the URL pattern you want to exclude ?

Stephen[/quote]
I am using Joomla. As the text editors and publisher are visiting the frontend page I don’t want to have their visits counted.
Using Google Analytics I added in the backend template


<body onLoad="javascript:pageTracker._setVar('intern');

In the admin area of Google Analytics I then could say that I don’t want to count visits with the value “intern”.

Using the ignore cookie of piwik is working similar but I don’t know how to set that cookie for all people visiting the backend.

Thanks.

Has anybody an idea what I could do?

You need to find the variable used in your CMS to define that the current page is a Backend page or not. Then, display the JS code for Piwik inside a IF() that will only display the code when the page is a backend page… But the solution is specific to your CMS / template language used.

I can load any code in the backend only. But which Piwik code should I load in the backend so the backend visitor is not counted automatically?

Just use a conditional if. In your HTML:


//Load piwik JS
...

//Set backend value depending on if admin or not
var frontend_page = true;

if (frontend_page)
{
    try {
        var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 15);
        piwikTracker.trackPageView();
        piwikTracker.enableLinkTracking();
    } catch( err ) {}
}

I want to avoid counting people visiting the frontend when they visited the backend too.

With your code I would not count people in the backend but when those people visit the frontend they get counted still. right?

Do you have a proposal for this as well?

Hi anyone out here who has an idea what I could do?

I am still looking how I can solve this.

Has anybody an idea what I could do?