From ed91fa3f676b88fc92797b7cbf2a0e6ac06dfd13 Mon Sep 17 00:00:00 2001 From: Igor Tregub Date: Thu, 22 Mar 2018 16:40:55 +0200 Subject: [PATCH 1/2] The method setTrackerUrl is registered more than once in "_paq" variable Update tracker.js --- view/frontend/web/js/tracker.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/view/frontend/web/js/tracker.js b/view/frontend/web/js/tracker.js index 5110991..f5350e4 100644 --- a/view/frontend/web/js/tracker.js +++ b/view/frontend/web/js/tracker.js @@ -288,7 +288,17 @@ define([ } /** - * Initialzie this component with given options + * Checks that piwik.js is already on page + * + * @param {String} scriptUrl + * @returns {boolean} + */ + function scriptExists(scriptUrl) { + return $('script[src="' + scriptUrl + '"]').length === 1; + } + + /** + * Initialize this component with given options * * @param {Object} options */ @@ -296,11 +306,13 @@ define([ defaultSiteId = options.siteId; defaultTrackerUrl = options.trackerUrl; if (piwik === null) { - pushAction([ - ['setSiteId', defaultSiteId], - ['setTrackerUrl', defaultTrackerUrl] - ]); - injectScript(options.scriptUrl); + if (!scriptExists(options.scriptUrl)) { + pushAction([ + ['setSiteId', defaultSiteId], + ['setTrackerUrl', defaultTrackerUrl] + ]); + injectScript(options.scriptUrl); + } } else { // If we already have the Piwik object we can resolve any pending // promises immediately. From 782d58f4ee093bd2e8bc8db634fecb3e6268327a Mon Sep 17 00:00:00 2001 From: Henrik Hedelund Date: Tue, 27 Mar 2018 20:19:57 +0200 Subject: [PATCH 2/2] Update build versions --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 962357e..c761997 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ php: - 7.1 - 7.0 env: + - M2_VERSION=2.2.3 - M2_VERSION=2.2.2 - M2_VERSION=2.2.1 - M2_VERSION=2.2.0