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

[piwik-js] Added support for registering plugins in Tracker public API #336

Merged
merged 2 commits into from Jun 30, 2014
Merged

[piwik-js] Added support for registering plugins in Tracker public API #336

merged 2 commits into from Jun 30, 2014

Conversation

sslavic
Copy link
Contributor

@sslavic sslavic commented Jun 30, 2014

So far adding plugins was only accessible through Piwik public API, Piwik.addPlugin.
Problem with this was that it was not possible to register plugins before any event has been handled, since Piwik singleton initialization (and any plugin registration) happens after _paq is processed and this is too late - any registered plugin will not be included in processing events fired by evaluation of _paq array items.

This patch enables registering Tracker plugins on Tracker itself, so addPlugin can be part of _paq instructions.
It is not enforced when addPlugin instructions will be processed (e.g. addPlugin is not part of alwaysFirst), for flexibility - e.g. one can have trackPageView evaluated without plugin, then addPlugin for all the next steps, or one can have addPlugin pushed first to _paq, and then trackPageView, if plugin should be applied for trackPageView as well.

@sslavic
Copy link
Contributor Author

sslavic commented Jun 30, 2014

The build has failed because of instability of test environment. JavaScript part of the build is green.

@sslavic
Copy link
Contributor Author

sslavic commented Jun 30, 2014

Related forum discussion: http://forum.piwik.org/read.php?15,117202

mattab pushed a commit that referenced this pull request Jun 30, 2014
[piwik-js] Added support for registering plugins in Tracker public API fixes #5393
@mattab mattab merged commit 2df1f90 into matomo-org:master Jun 30, 2014
mattab added a commit that referenced this pull request Jun 30, 2014
@sslavic sslavic deleted the tracker_addPlugin branch July 1, 2014 21:15
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

Successfully merging this pull request may close these issues.

None yet

2 participants