O'Reilly logo

Piwik Web Analytics Essentials by Stephan A. Miller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up download and outlink tracking

In the default tracking code given to you by Piwik, download and outlink tracking is enabled by default. This line of the tracking code does it:

...
piwikTracker.enableLinkTracking();
...

The easiest way to disable all download and outlink tracking is to comment out this line of code; like so:

...
//piwikTracker.enableLinkTracking();
...

Disabling link tracking

If you still need to track some links but not all, an easy way to do it is by using CSS classes. Piwik lets you specify which classes of links will not be tracked.

Note

setIgnoreClasses(string|array): This function sets CSS classes to be ignored, if present in the link.

So, if you have a set of links to other sites on a specific page on your site that you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required