Is there a way for a plugin to add custom JS to tracker response and have the piwik.js parse/execute it?
It is technically possible but as @mattab mentioned there are no docs which actually is missing because it is not really a public API and neither supported right now. Basically you can create a
tracker.js file or
tracker.min.js file in your plugin and it will be copied into the piwik.js
@tsteur maybe we could make this public API in Piwik 4? (moving tentatively)
could maybe make it but maybe lets see again when we get to it. Would require a bit more work and especially documentation. Not having a big opinion on it but would need to think more about it also for long term how this should work