How to create "tracker" plugin?

I need to do server side plugin, that would rewrite the URL and Title, that came through the standard piwik tracker - i cannot add/change the javascript code. The plugin will take some values from other dimensions and based on them it will update the URL / title, so that it is save to the log_ tables changed (so not changing afterwards, not changing on javascript …)
Please can someone points me to the proper way how to do it? Or create a simplest possible example - i will pay for it. I have not found any examples except some very old ones for old versions of piwik, that do not work now. Thanks