How to redirect to another URL from matomo.php URL

Hey guys,

I am trying to redirect to another URL can be the page where tracker is implemented and can be an external link. I want to use redirection to happen post matomo.php call for example something shown below

Use case I want to track links clicked in an email. there can be multiple links can be internal and external, I want to track all that, how do I do that?

how do I achieve this?


The closest I know to this is this plugin: