There are a number of plugins that make ‘pretty links’ that are widely used for affiliate programs. Most of these plugins make the management of thousands of links much more manageable, because they update all links on your website instead you doing it manually, one-by-one, when a affiliate programs stops or changes.
needless to say, these cloaked links are essential for many websites, including mine.
The sad part is, is that Matomo doesn’t register these clicks. When I check outgoing links, it doesn’t show them, probably because the outgoing links are ‘pretty’ and start with my own domain name, like ‘mydomain/out/customlink’.
Is there a way to have Matomo recognize these links and register them as outgoing clicks?
As far as I know, unlike download links, there is no way to insert an identifier, for example in the form of a CSS class, which the Matomo tracker automatically uses to recognize the click as an outgoing.
The solution that comes to mind for your issue is to track the affiliate link clicks to your own domain as part of event tracking or goal tracking.
You can do this either with the Matomo Tag Manager or by manually inserting click event listeners in JavaScript.
agree with @utrautma here, you’re better off trying to track clicks on those buttons, then you could theoretically get the URL of that click if the JS changes there.
Then you can go a step further and integrate this with an API and get the target domain of that pretty link, and match this lets say in a BigQuery database or even a Looker Studio database (thinking out loud).
Also thinking these links are on a button that has a css class, and you could filter down your tracking to those type of buttons.