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:

will be rewritten with rewriterule to:

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:

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” );

and put this in my outbound links:

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