How to track outbound redirects (rewrites)?

Maybe its allready covered but I don’t know how to search for similar topics.

My affiliate links are rewritten through .htaccess, so for example this link:

www.mydomain.com/shop/123456.html

will be rewritten with rewriterule to:

www.amazon.com/itemnr=1234565

How can I track the clicks on my /shop/ links?

You can record clicks to specific links as “outlinks” and display them in this report, see: http://piwik.org/docs/javascript-tracking/#toc-force-a-click-on-a-link-to-be-recorded-as-an-outlink-in-piwik

OK, thanks, so I added:

piwikTracker.setLinkClasses( “external” );

in the Piwik code like this:


try {
var piwikTracker = Piwik.getTracker(pkBaseURL + “piwik.php”, 2);
piwikTracker.setLinkClasses( “external” );
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();

and put this in my outbound links:
click

but I don’t see any data coming through -> visitors -> custom variables:
There is no data for this report.

The data will be logged in Actions > Outlinks