Hello Piwik community,
It doesn’t seem possible to register a piwik.js plugin before any event is tracked.
To register piwik.js plugin one is supposed to call Piwik.addPlugin method.
I’m trying to call it from a function pushed to _paq, but items in _paq are evaluated before Piwik is constructed so before Piwik public methods like addPlugin are even declared.
Am I missing something?
I’m guessing that the order of statements in Piwik constructor isn’t correct to allow registering plugins before tracking any events.
Maybe a solution would be to move Piwik.addPlugin to the Tracker, or add equivalent addPlugin method to the Tracker public API, and make that addPlugin part of applyFirst (methods which execute first if pushed in _paq).