Hooking in JavaScript code from Plugin #1635
Labels
duplicate
For issues that already existed in our issue tracker and were reported previously.
Enhancement
For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
It seems like there's no way to hook in custom javascript/file through the tracker (piwik.js) code. This is required by third-party plugins to gather more information from client-side environment in addition to that provided by Piwik's own tracker. There exist hooks in piwik.js, but I think there's no way to utilize them without injecting/modifying the default tracker script/code/tags.
I am working on a HeatMap/ClickMap plugin for Piwik (from scratch, not based off the well-known ClickHeat plugin). In order to track client side events, I must make additions to the tracker script or hook it somehow into the tracker so that my script/code is executed. Using a separate JavaScript tag, in addition to piwik.js, does the job:
But, I am actually looking forward to a seamless integration mechanism where users won't have to modify existing Piwik tracking tags. Ideally Piwik tracker code would pull the plugin code. This may be possible by dynamically generating (and caching) piwik.js and including blocks of codes pre-registered by third-party plugins, right within piwik.js.
The text was updated successfully, but these errors were encountered: