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
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 ?
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
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.
//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 ) {}
}