Make tracking with multiple trackers more consistent and robust #10952
Labels
c: Usability
For issues that let users achieve a defined goal more effectively or efficiently.
Enhancement
For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone
By default tracking is done like this:
_paq.push(['trackFooBar', 'param1', 'param2])
.When working with multiple trackers (and tracking different data to different sites) the same would be
I think it would be more consistent to always use a push method as well instead:
This simplifies some docs greatly, for example http://developer.piwik.org/guides/media-analytics/reference where we always need to explain how and where to call different kind of plugin tracker methods.
It would also make it more robust since
tracker.trackFooBar()
would result in an error when it is not defined but in the push method we can log or ignore certain methods, etcIt would also work with global tracker plugin methods (the ones that have
::
) and works perfectly with custom tracker methods. Even when a plugin is uninstalled tracking would still work becausetracker.MediaAnalytics.scanForMedia
would not result in an error when done like this:tracker.push(['MediaAnalytics.scanForMedia'])
.Easier to port code between
_paq.push
and multiple trackers. Because syntax is the same it is much easier to move from one solution to another.The text was updated successfully, but these errors were encountered: