Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Pilot001 opened this issue Jan 26, 2021 · 1 comment

Comments

@Pilot001
Copy link

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
Copy link
Owner

jbrule commented Feb 12, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants