diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-08-25 10:44:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-25 10:44:08 +0300 |
commit | cdc9232ee81e679af3d628e92cc13d3e537590ee (patch) | |
tree | 7da4ba7e75fa6c725cdb09d08d400be5c3ae50d9 /plugins/ExampleTracker | |
parent | 4df7ec5d81d40b6cebbdf6a6375e426ae92357f0 (diff) |
Adjust example tracker to the breaking changes in Matomo 4 (#16343)
the Piwik namespace change wouldn't be needed but could to do anyway.
Diffstat (limited to 'plugins/ExampleTracker')
-rw-r--r-- | plugins/ExampleTracker/tracker.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/ExampleTracker/tracker.js b/plugins/ExampleTracker/tracker.js index 25cd27d12b..00c93e8b63 100644 --- a/plugins/ExampleTracker/tracker.js +++ b/plugins/ExampleTracker/tracker.js @@ -11,21 +11,21 @@ var configs = {}; function init() { - if ('object' === typeof window && 'object' === typeof window.Piwik && 'object' === typeof window.Piwik.ExampleTracker) { + if ('object' === typeof window && 'object' === typeof window.Matomo && 'object' === typeof window.Matomo.ExampleTracker) { // do not initialize twice return; } - if ('object' === typeof window && !window.Piwik) { - // piwik is not defined yet + if ('object' === typeof window && !window.Matomo) { + // matomo is not defined yet return; } - Piwik.ExampleTracker = { + Matomo.ExampleTracker = { // empty }; - Piwik.addPlugin('ExampleTracker', { + Matomo.addPlugin('ExampleTracker', { log: function (eventParams) { if (!eventParams || !eventParams.tracker) { return ''; @@ -36,15 +36,15 @@ }); } - if ('object' === typeof window.Piwik) { + if ('object' === typeof window.Matomo) { init(); } else { // tracker is loaded separately for sure - if ('object' !== typeof window.piwikPluginAsyncInit) { - window.piwikPluginAsyncInit = []; + if ('object' !== typeof window.matomoPluginAsyncInit) { + window.matomoPluginAsyncInit = []; } - window.piwikPluginAsyncInit.push(init); + window.matomoPluginAsyncInit.push(init); } -})();
\ No newline at end of file +})(); |