jbrule / piwikplugin-TrackingCodeCustomizer

Tracking Code Customizer plugin for the Piwik Web Analytics software package
GNU General Public License v3.0
1 stars 2 forks source link

Other tracking code snipplets don't get the modifications (enhancement request) #8

Open Pilot001 opened 3 years ago

Pilot001 commented 3 years ago

In my case, it is necessary to modify the hostname within the trackingcode, as the admin-UI is available under a different hostname than the tracker endpoint, and such the developers copy a wrong tracking code. I really appreciate this plugin. I wrote a much simpler one (static, no form) to change the code snipplets on my own once before. But IMHO it is necessary that all tracking snipplets get those changes. The current version just modifies the javascript tracking code. In some cases other options, e. g. tracking with a pixel is used. That code snipplet still shows the wrong hostname. At least up to Matomo 3.x it could simply be done by adding a second hook to "SitesManager.getImageTrackingCode". I haven't checked this for Matomo 4.x, yet. I would love to be able to say there was another hook for the tagmanager container snipplets, but currently it seem's there isn't.

Best regards, Alexander Maus

jbrule commented 3 years ago

Thank you for bringing this to my attention. I don't use image tracking in my deployment but it is good to have a comprehensive solution. I believe I should be able to modify some of the variables using the postEvent hook here https://github.com/matomo-org/matomo/blob/fd14a155269038f6fe12ce31db20f8ebffaf00c5/plugins/SitesManager/API.php#L176 . I'll need to research the Tag Manager as I am not very familiar with its internals.