From 9af820d3622739f1a6093a5a83f8c9da8c856203 Mon Sep 17 00:00:00 2001 From: Jacob Ransom Date: Thu, 9 May 2024 14:12:48 +1200 Subject: [PATCH 1/3] Revert "Merge pull request #723 from matomo-org/pg-2764-retry-mtm-tracking-improvement" This reverts commit 1eed6a4df5a3038111b4ba4d9afc51636bc7689b, reversing changes made to 5cb1114986a4a0b487c2ca2984fbbeea048aef7a. --- Template/Tag/MatomoTag.web.js | 363 ++---------------- javascripts/tagmanager.js | 20 - javascripts/tagmanager.min.js | 11 +- .../resources/anotherTrackerTestExample.html | 80 ---- .../resources/complexTrackerTestExample.html | 62 --- tests/resources/trackerTestExample.html | 49 --- 6 files changed, 38 insertions(+), 547 deletions(-) delete mode 100644 tests/resources/anotherTrackerTestExample.html delete mode 100644 tests/resources/complexTrackerTestExample.html delete mode 100644 tests/resources/trackerTestExample.html diff --git a/Template/Tag/MatomoTag.web.js b/Template/Tag/MatomoTag.web.js index 637095319..33501d5d0 100644 --- a/Template/Tag/MatomoTag.web.js +++ b/Template/Tag/MatomoTag.web.js @@ -13,20 +13,7 @@ } }; - // Make sure that window._paq always exists - if (!window._paq) { - window._paq = []; - } - // Store the initial state of window._paq so that we can apply it to all the configs - // We use the stringify and parse to make sure that we have a copy and not a reference - var localPaq = window._paq && window._paq.length ? JSON.parse(JSON.stringify(window._paq)) : localPaq || []; - var indexesOfConfigs = []; - // Clear window._paq to prevent things from being tracked too early - while (window._paq.length > 0) { - window._paq.pop(); - } - - var hasProcessedRemainingTrackings = false; + window._paq = window._paq || []; if ('object' !== typeof window.matomoPluginAsyncInit) { window.matomoPluginAsyncInit = []; @@ -82,15 +69,6 @@ } } - function markIndexAsConfig(index) - { - if (index < 0) { - return; - } - - indexesOfConfigs.push(index); - } - var configuredTrackers = {}; return function (parameters, TagManager) { @@ -117,9 +95,6 @@ // configurations var variableName = parameters.matomoConfig.name; - var setCustomDimensionIndexes = []; - indexesOfConfigs = []; - // we need to fetch matomoConfig again in case some parameters changed meanwhile that are variables... // eg userId might be a variable and it's value might be different now var matomoConfig = parameters.get('matomoConfig', {}); @@ -143,250 +118,53 @@ } configuredTrackers[variableName] = tracker; - // NOTE: When a new config is created, it should probably be added to this list - // There might already be some configs missing from this list - var setUserIdIndex = setSiteIdIndex = setTrackerUrlIndex - = requireCookieConsentIndex = disableBrowserFeatureDetectionIndex - = disableCookiesIndex = enableCrossDomainLinkingIndex - = setCrossDomainLinkingTimeoutIndex = cookieSameSiteIndex - = setVisitorCookieTimeoutIndex = setReferralCookieTimeoutIndex - = setSessionCookieTimeoutIndex = setSecureCookieIndex = cookiePathIndex - = cookieNamePrefixIndex = cookieDomainIndex = setDomainsIndex - = alwaysUseSendBeaconIndex = disableAlwaysUseSendBeaconIndex - = setRequestMethodIndex = enableLinkTrackingIndex = enableFileTrackingIndex - = requireConsentIndex = enableDoNotTrackIndex - = disablePerformanceTrackingIndex = appendToTrackingUrlIndex - = setRequestContentTypeIndex = setCustomRequestProcessingIndex - = enableJSErrorTrackingIndex = enableHeartBeatTimerIndex - = trackAllContentImpressionsIndex = trackVisibleContentImpressionsIndex - = disableFormAnalyticsIndex = disableMediaAnalyticsIndex - = disableCampaignParametersIndex = -1; - for (k = 0; k < localPaq.length; k++) { - // This should only be an array. Skip if it's not - if (!TagManager.utils.isArray(localPaq[k])) { - continue; - } - var name = localPaq[k][0]; - switch (name) { - case 'setUserId': - setUserIdIndex = k; - // Mark this one for removal right away since we don't want it to override the container - markIndexAsConfig(k); - break; - case 'setSiteId': - setSiteIdIndex = k; - // Mark this one for removal right away since we don't want it to override the container - markIndexAsConfig(k); - break; - case 'setTrackerUrl': - setTrackerUrlIndex = k; - // Mark this one for removal right away since we don't want it to override the container - markIndexAsConfig(k); - break; - case 'requireCookieConsent': - requireCookieConsentIndex = k; - break; - case 'disableBrowserFeatureDetection': - disableBrowserFeatureDetectionIndex = k; - break; - case 'disableCookies': - disableCookiesIndex = k; - break; - case 'enableCrossDomainLinking': - enableCrossDomainLinkingIndex = k; - break; - case 'setCrossDomainLinkingTimeout': - setCrossDomainLinkingTimeoutIndex = k; - break; - case 'cookieSameSite': - cookieSameSiteIndex = k; - break; - case 'setVisitorCookieTimeout': - setVisitorCookieTimeoutIndex = k; - break; - case 'setReferralCookieTimeout': - setReferralCookieTimeoutIndex = k; - break; - case 'setSessionCookieTimeout': - setSessionCookieTimeoutIndex = k; - break; - case 'setSecureCookie': - setSecureCookieIndex = k; - break; - case 'cookiePath': - cookiePathIndex = k; - break; - case 'cookieNamePrefix': - cookieNamePrefixIndex = k; - break; - case 'cookieDomain': - cookieDomainIndex = k; - break; - case 'setDomains': - setDomainsIndex = k; - break; - case 'alwaysUseSendBeacon': - alwaysUseSendBeaconIndex = k; - break; - case 'disableAlwaysUseSendBeacon': - disableAlwaysUseSendBeaconIndex = k; - break; - case 'enableLinkTracking': - enableLinkTrackingIndex = k; - break; - case 'enableFileTracking': - enableFileTrackingIndex = k; - break; - case 'requireConsent': - requireConsentIndex = k; - break; - case 'enableDoNotTrack': - enableDoNotTrackIndex = k; - break; - case 'disablePerformanceTracking': - disablePerformanceTrackingIndex = k; - break; - case 'appendToTrackingUrl': - appendToTrackingUrlIndex = k; - break; - case 'setRequestContentType': - setRequestContentTypeIndex = k; - break; - case 'setCustomRequestProcessing': - setCustomRequestProcessingIndex = k; - break; - case 'enableJSErrorTracking': - enableJSErrorTrackingIndex = k; - break; - case 'enableHeartBeatTimer': - enableHeartBeatTimerIndex = k; - break; - case 'trackAllContentImpressions': - trackAllContentImpressionsIndex = k; - break; - case 'trackVisibleContentImpressions': - trackVisibleContentImpressionsIndex = k; - break; - case 'FormAnalytics::disable': - case 'FormAnalytics::disableFormAnalytics': - case 'FormAnalytics.disableFormAnalytics': - case 'disableFormAnalytics': - disableFormAnalyticsIndex = k; - break; - case 'MediaAnalytics::disable': - case 'MediaAnalytics::disableMediaAnalytics': - case 'MediaAnalytics.disableMediaAnalytics': - case 'disableMediaAnalytics': - disableMediaAnalyticsIndex = k; - break; - case 'setCustomDimension': - // There could be multiple, so let's push the indexes onto an array - setCustomDimensionIndexes.push(k); - break; - case 'disableCampaignParameters': - disableCampaignParametersIndex = k; - break; - } - } - - if (matomoConfig.requireCookieConsent || requireCookieConsentIndex !== -1) { - tracker.requireCookieConsent(); - markIndexAsConfig(requireCookieConsentIndex); + if (matomoConfig.requireCookieConsent) { + tracker.requireCookieConsent(); } - if ((matomoConfig.disableBrowserFeatureDetection || disableBrowserFeatureDetectionIndex !== -1) && typeof tracker.disableBrowserFeatureDetection === 'function') { + if (matomoConfig.disableBrowserFeatureDetection && typeof tracker.disableBrowserFeatureDetection === 'function') { tracker.disableBrowserFeatureDetection(); - markIndexAsConfig(disableBrowserFeatureDetectionIndex); } - if (matomoConfig.disableCampaignParameters || disableCampaignParametersIndex !== -1) { + if (matomoConfig.disableCampaignParameters) { tracker.disableCampaignParameters(); - markIndexAsConfig(disableCampaignParametersIndex); } - if (matomoConfig.disableCookies || disableCookiesIndex !== -1) { + if (matomoConfig.disableCookies) { tracker.disableCookies(); - markIndexAsConfig(disableCookiesIndex); } - if (matomoConfig.enableCrossDomainLinking || enableCrossDomainLinkingIndex !== -1) { + if (matomoConfig.enableCrossDomainLinking) { tracker.enableCrossDomainLinking(); - markIndexAsConfig(enableCrossDomainLinkingIndex); - } - - if (setCrossDomainLinkingTimeoutIndex !== -1 && localPaq[setCrossDomainLinkingTimeoutIndex].length === 2) { - tracker.setCrossDomainLinkingTimeout(localPaq[setCrossDomainLinkingTimeoutIndex][1]); - markIndexAsConfig(setCrossDomainLinkingTimeoutIndex); - } else if (matomoConfig.enableCrossDomainLinking && matomoConfig.crossDomainLinkingTimeout) { tracker.setCrossDomainLinkingTimeout(matomoConfig.crossDomainLinkingTimeout); } - if (cookieSameSiteIndex !== -1 && localPaq[cookieSameSiteIndex].length === 2) { - tracker.setCookieSameSite(localPaq[cookieSameSiteIndex][1]); - markIndexAsConfig(cookieSameSiteIndex); - } else if (matomoConfig.cookieSameSite) { + if (matomoConfig.cookieSameSite) { tracker.setCookieSameSite(matomoConfig.cookieSameSite); } - if (setVisitorCookieTimeoutIndex !== -1 && localPaq[setVisitorCookieTimeoutIndex].length === 2) { - tracker.setVisitorCookieTimeout(localPaq[setVisitorCookieTimeoutIndex][1]); - markIndexAsConfig(setVisitorCookieTimeoutIndex); - } else if (matomoConfig.customCookieTimeOutEnable) { + if (matomoConfig.customCookieTimeOutEnable) { tracker.setVisitorCookieTimeout(matomoConfig.customCookieTimeOut * 86400); - } - - if (setReferralCookieTimeoutIndex !== -1 && localPaq[setReferralCookieTimeoutIndex].length === 2) { - tracker.setReferralCookieTimeout(localPaq[setReferralCookieTimeoutIndex][1]); - markIndexAsConfig(setReferralCookieTimeoutIndex); - } else if (matomoConfig.customCookieTimeOutEnable) { tracker.setReferralCookieTimeout(matomoConfig.referralCookieTimeOut * 86400); - } - - if (setSessionCookieTimeoutIndex !== -1 && localPaq[setSessionCookieTimeoutIndex].length === 2) { - tracker.setSessionCookieTimeout(localPaq[setSessionCookieTimeoutIndex][1]); - markIndexAsConfig(setSessionCookieTimeoutIndex); - } else if (matomoConfig.customCookieTimeOutEnable) { tracker.setSessionCookieTimeout(matomoConfig.sessionCookieTimeOut * 60); } - if (matomoConfig.setSecureCookie || setSecureCookieIndex !== -1) { + if (matomoConfig.setSecureCookie) { tracker.setSecureCookie(true); - markIndexAsConfig(setSecureCookieIndex); } - if (cookiePathIndex !== -1 && localPaq[cookiePathIndex].length === 2) { - tracker.setCookiePath(localPaq[cookiePathIndex][1]); - markIndexAsConfig(cookiePathIndex); - } else if (matomoConfig.cookiePath) { + if (matomoConfig.cookiePath) { tracker.setCookiePath(matomoConfig.cookiePath); } - if (cookieNamePrefixIndex !== -1 && localPaq[cookieNamePrefixIndex].length === 2) { - tracker.setCookiePath(localPaq[cookieNamePrefixIndex][1]); - markIndexAsConfig(cookieNamePrefixIndex); - } else if (matomoConfig.cookieNamePrefix) { - tracker.setCookiePath(matomoConfig.cookieNamePrefix); + if (matomoConfig.cookieNamePrefix) { + tracker.setCookieNamePrefix(matomoConfig.cookieNamePrefix); } - if (cookieDomainIndex !== -1 && localPaq[cookieDomainIndex].length === 2) { - tracker.setCookieDomain(localPaq[cookieDomainIndex][1]); - markIndexAsConfig(cookieDomainIndex); - } else if (matomoConfig.cookieDomain) { + if (matomoConfig.cookieDomain) { tracker.setCookieDomain(matomoConfig.cookieDomain); } - // If paq.push(['setDomains' has been called, override the Matomo config domains - if (setDomainsIndex !== -1 && localPaq[setDomainsIndex].length === 2) { - var domainsArray = localPaq[setDomainsIndex][1]; - // It's valid to provide a string if there's only one domain - if (typeof localPaq[setDomainsIndex][1] === 'string') { - domainsArray = [localPaq[setDomainsIndex][1]]; - } - if (TagManager.utils.isArray(domainsArray)) { - matomoConfig.domains = domainsArray; - } - markIndexAsConfig(setDomainsIndex); - } if (matomoConfig.domains && TagManager.utils.isArray(matomoConfig.domains) && matomoConfig.domains.length) { @@ -405,110 +183,67 @@ tracker.setDomains(domains); } - if (matomoConfig.alwaysUseSendBeacon || alwaysUseSendBeaconIndex !== -1) { + if (matomoConfig.alwaysUseSendBeacon) { tracker.alwaysUseSendBeacon(); - markIndexAsConfig(alwaysUseSendBeaconIndex); } - if (matomoConfig.disableAlwaysUseSendBeacon || disableAlwaysUseSendBeaconIndex !== -1) { + if (matomoConfig.disableAlwaysUseSendBeacon) { tracker.disableAlwaysUseSendBeacon(); - markIndexAsConfig(disableAlwaysUseSendBeaconIndex); } - if (appendToTrackingUrlIndex !== -1 && localPaq[appendToTrackingUrlIndex].length === 2 - && typeof localPaq[appendToTrackingUrlIndex][1] === 'string' - && ['POST', 'GET'].includes(localPaq[appendToTrackingUrlIndex][1].toUpperCase())) { - tracker.setRequestMethod(localPaq[appendToTrackingUrlIndex][1]); - if (localPaq[appendToTrackingUrlIndex][1].toUpperCase() === 'POST' - && setRequestContentTypeIndex !== -1 && localPaq[setRequestContentTypeIndex].length === 2 - && typeof localPaq[setRequestContentTypeIndex][1] === 'string' && localPaq[setRequestContentTypeIndex][1].length > 0) { - tracker.setRequestContentType(localPaq[setRequestContentTypeIndex][1]); - markIndexAsConfig(setRequestContentTypeIndex); - } - markIndexAsConfig(appendToTrackingUrlIndex); - } else if (matomoConfig.forceRequestMethod && typeof matomoConfig.requestMethod === 'string' - && ['POST', 'GET'].includes(matomoConfig.requestMethod.toUpperCase())) { + if (matomoConfig.forceRequestMethod) { tracker.setRequestMethod(matomoConfig.requestMethod); - if(matomoConfig.requestMethod.toUpperCase() === 'POST'){ + if(matomoConfig.requestMethod == 'POST'){ tracker.setRequestContentType(matomoConfig.requestContentType); } } - if (matomoConfig.enableLinkTracking || enableLinkTrackingIndex !== -1) { + if (matomoConfig.enableLinkTracking) { tracker.enableLinkTracking(); - markIndexAsConfig(enableLinkTrackingIndex); } - if (matomoConfig.enableFileTracking || enableFileTrackingIndex !== -1) { + if (matomoConfig.enableFileTracking) { tracker.enableFileTracking(); - markIndexAsConfig(enableFileTrackingIndex); } - if (matomoConfig.requireConsent || requireConsentIndex !== -1) { + if (matomoConfig.requireConsent) { tracker.requireConsent(); - markIndexAsConfig(requireConsentIndex); } - if (matomoConfig.enableDoNotTrack || enableDoNotTrackIndex !== -1) { + if (matomoConfig.enableDoNotTrack) { tracker.setDoNotTrack(1); - markIndexAsConfig(enableDoNotTrackIndex); } - if (matomoConfig.disablePerformanceTracking || disablePerformanceTrackingIndex !== -1) { + if (matomoConfig.disablePerformanceTracking) { tracker.disablePerformanceTracking(); - markIndexAsConfig(disablePerformanceTrackingIndex); } - if (appendToTrackingUrlIndex !== -1 && localPaq[appendToTrackingUrlIndex].length === 2 - && typeof localPaq[appendToTrackingUrlIndex][1] === 'string' && localPaq[appendToTrackingUrlIndex][1].length > 0) { - tracker.appendToTrackingUrl(localPaq[appendToTrackingUrlIndex][1]); - markIndexAsConfig(appendToTrackingUrlIndex); - } else if (typeof matomoConfig.appendToTrackingUrl === 'string' && matomoConfig.appendToTrackingUrl.length > 0) { + if (typeof matomoConfig.appendToTrackingUrl === 'string' && matomoConfig.appendToTrackingUrl.length > 0) { tracker.appendToTrackingUrl(matomoConfig.appendToTrackingUrl); } - if (setCustomRequestProcessingIndex !== -1 && localPaq[setCustomRequestProcessingIndex].length === 2 - && typeof localPaq[setCustomRequestProcessingIndex][1] === 'function' && localPaq[setCustomRequestProcessingIndex][1].length >= 1) { - tracker.setCustomRequestProcessing(localPaq[setCustomRequestProcessingIndex][1]); - markIndexAsConfig(setCustomRequestProcessingIndex); - } else if(typeof matomoConfig.customRequestProcessing === 'function' && matomoConfig.customRequestProcessing.length >= 1) { + if(typeof matomoConfig.customRequestProcessing === 'function' + && matomoConfig.customRequestProcessing.length >= 1 ) { tracker.setCustomRequestProcessing(matomoConfig.customRequestProcessing); } - if (matomoConfig.enableJSErrorTracking || enableJSErrorTrackingIndex !== -1) { + if (matomoConfig.enableJSErrorTracking) { tracker.enableJSErrorTracking(); - markIndexAsConfig(enableJSErrorTrackingIndex); } - - if (matomoConfig.enableHeartBeatTimer || enableHeartBeatTimerIndex !== -1) { - if (enableHeartBeatTimerIndex !== -1 && localPaq[enableHeartBeatTimerIndex].length === 2) { - tracker.enableHeartBeatTimer(localPaq[enableHeartBeatTimerIndex][1]); - } else if (matomoConfig.heartBeatTime) { - tracker.enableHeartBeatTimer(matomoConfig.heartBeatTime); - } else { - tracker.enableHeartBeatTimer(); - } - markIndexAsConfig(enableHeartBeatTimerIndex); + if (matomoConfig.enableHeartBeatTimer) { + tracker.enableHeartBeatTimer(matomoConfig.heartBeatTime); } - - if (matomoConfig.trackAllContentImpressions || trackAllContentImpressionsIndex !== -1) { + if (matomoConfig.trackAllContentImpressions) { tracker.trackAllContentImpressions(); - markIndexAsConfig(trackAllContentImpressionsIndex); } - - if (matomoConfig.trackVisibleContentImpressions || trackVisibleContentImpressionsIndex !== -1) { + if (matomoConfig.trackVisibleContentImpressions) { tracker.trackVisibleContentImpressions(); - markIndexAsConfig(trackVisibleContentImpressionsIndex); } - - if (((matomoConfig.hasOwnProperty('enableFormAnalytics') && !matomoConfig.enableFormAnalytics) || disableFormAnalyticsIndex !== -1) && window.Matomo && window.Matomo.FormAnalytics && typeof window.Matomo.FormAnalytics.disableFormAnalytics === 'function') { + if (matomoConfig.hasOwnProperty('enableFormAnalytics') && !matomoConfig.enableFormAnalytics && window.Matomo && window.Matomo.FormAnalytics && typeof window.Matomo.FormAnalytics.disableFormAnalytics === 'function') { window.Matomo.FormAnalytics.disableFormAnalytics(); - markIndexAsConfig(disableFormAnalyticsIndex); } - - if (((matomoConfig.hasOwnProperty('enableMediaAnalytics') && !matomoConfig.enableMediaAnalytics) || disableMediaAnalyticsIndex !== -1) && window.Matomo && window.Matomo.MediaAnalytics && typeof window.Matomo.MediaAnalytics.disableMediaAnalytics === 'function') { + if (matomoConfig.hasOwnProperty('enableMediaAnalytics') && !matomoConfig.enableMediaAnalytics && window.Matomo && window.Matomo.MediaAnalytics && typeof window.Matomo.MediaAnalytics.disableMediaAnalytics === 'function') { window.Matomo.MediaAnalytics.disableMediaAnalytics(); - markIndexAsConfig(disableMediaAnalyticsIndex); } } @@ -532,23 +267,6 @@ lastIdSite = possiblyUpdatedMatomoUrl; } - // Add any custom dimensions added to _paq to the collection - if (setCustomDimensionIndexes.length) { - if (!matomoConfig.customDimensions - || !TagManager.utils.isArray(matomoConfig.customDimensions)) { - matomoConfig.customDimensions = []; - } - for (indexIndex = 0; indexIndex < setCustomDimensionIndexes.length; indexIndex++) { - var customDim = localPaq[setCustomDimensionIndexes[indexIndex]]; - if (TagManager.utils.isArray(customDim) && customDim.length === 3) { - matomoConfig.customDimensions.push({ - index: customDim[1], - value: customDim[2], - }); - } - markIndexAsConfig(setCustomDimensionIndexes[indexIndex]); - } - } if (matomoConfig.customDimensions && TagManager.utils.isArray(matomoConfig.customDimensions) && matomoConfig.customDimensions.length) { @@ -561,21 +279,6 @@ } } - // If the remaining _paq values haven't been processed yet, process them - // We wait till now so that all configs are applied first - var applyRemainingPaqEntries = parameters.get('applyRemainingPaqEntries', false); - if (!hasProcessedRemainingTrackings && localPaq.length > indexesOfConfigs.length && applyRemainingPaqEntries) { - hasProcessedRemainingTrackings = true; - for (trackingIndex = 0; trackingIndex < localPaq.length; trackingIndex++) { - // Skip config items since they've already been processed - if (indexesOfConfigs.indexOf(trackingIndex) >= 0) { - continue; - } - - window._paq.push(localPaq[trackingIndex]); - } - } - if (tracker) { var trackingType = parameters.get('trackingType'); diff --git a/javascripts/tagmanager.js b/javascripts/tagmanager.js index b051fb43a..3fb12c661 100644 --- a/javascripts/tagmanager.js +++ b/javascripts/tagmanager.js @@ -1675,28 +1675,8 @@ } if (container.tags && utils.isArray(container.tags)) { - // Build a collection of the names of all the Matomo configs - var hasMatomoTag = false; - var matomoConfigNames = []; for (i = 0; i < container.tags.length; i++) { tagDefinition = container.tags[i]; - if (tagDefinition.type === 'Matomo' && matomoConfigNames.indexOf(tagDefinition.parameters.matomoConfig.name) === -1) { - hasMatomoTag = true; - matomoConfigNames.push(tagDefinition.parameters.matomoConfig.name); - } - } - for (i = 0; i < container.tags.length; i++) { - tagDefinition = container.tags[i]; - // If the Matomo config name is in the list, remove it - if (hasMatomoTag && tagDefinition.parameters.matomoConfig && matomoConfigNames.indexOf(tagDefinition.parameters.matomoConfig.name) !== -1) { - matomoConfigNames.splice(tagDefinition.parameters.matomoConfig.name, 1); - } - // If all the names have been removed, that means all configs are found - // If configs are ready, set tag ready to apply all postponed _paq entries - // This is because we postpone _paq entries to apply them on all trackers - if (hasMatomoTag && matomoConfigNames.length === 0) { - tagDefinition.parameters.applyRemainingPaqEntries = true; - } tag = new Tag(tagDefinition, this); this.tags.push(tag); diff --git a/javascripts/tagmanager.min.js b/javascripts/tagmanager.min.js index a7e4d6eb5..34236963c 100644 --- a/javascripts/tagmanager.min.js +++ b/javascripts/tagmanager.min.js @@ -33,11 +33,10 @@ L=undefined}if((!B.isDefined(L)||L===null||L===false)&&B.isDefined(this.defaultV }}})}};this.addReferencedTag=function(i){this.referencedTags.push(i)};this.getReferencedTags=function(){return this.referencedTags};this.meetsConditions=function(){var L,M;for(L=0;L0;if(L){var G,J;G=H.split("::");J=G[0];H=G[1];if("object"===typeof l[J]&&B.isFunction(l[J][H])){l[J][H].apply(l[J],M)}}else{if(H&&H in l&&B.isFunction(l[H])){l[H].apply(l,M)}else{y.error("method "+H+" is not valid")}}}}B.setMethodWrapIfNeeded(a._mtm,"push",g);var v;for(v=0;v0;if(L){var G,J;G=H.split("::");J=G[0];H=G[1];if("object"===typeof l[J]&&B.isFunction(l[J][H])){l[J][H].apply(l[J],M)}}else{if(H&&H in l&&B.isFunction(l[H])){l[H].apply(l,M)}else{y.error("method "+H+" is not valid")}}}}B.setMethodWrapIfNeeded(a._mtm,"push",g);var v;for(v=0;v - - - - - - - - - - - - - - - - - - -
-

Hello World!

-
-
-
-
-
-
- - diff --git a/tests/resources/complexTrackerTestExample.html b/tests/resources/complexTrackerTestExample.html deleted file mode 100644 index 3a531651f..000000000 --- a/tests/resources/complexTrackerTestExample.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - -
-

Hello World!

-
-
-
-
-
-
- - diff --git a/tests/resources/trackerTestExample.html b/tests/resources/trackerTestExample.html deleted file mode 100644 index b5688c04e..000000000 --- a/tests/resources/trackerTestExample.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - -
-

Hello World!

- -
- - \ No newline at end of file From c2d723254d5443ebdaf5c799f7ccde284bb4bf98 Mon Sep 17 00:00:00 2001 From: Jacob Ransom Date: Fri, 10 May 2024 10:41:48 +1200 Subject: [PATCH 2/3] Adding example files back in, since we don't need to revert those --- .../resources/anotherTrackerTestExample.html | 80 +++++++++++++++++++ .../resources/complexTrackerTestExample.html | 62 ++++++++++++++ tests/resources/trackerTestExample.html | 49 ++++++++++++ 3 files changed, 191 insertions(+) create mode 100644 tests/resources/anotherTrackerTestExample.html create mode 100644 tests/resources/complexTrackerTestExample.html create mode 100644 tests/resources/trackerTestExample.html diff --git a/tests/resources/anotherTrackerTestExample.html b/tests/resources/anotherTrackerTestExample.html new file mode 100644 index 000000000..c343ca61c --- /dev/null +++ b/tests/resources/anotherTrackerTestExample.html @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + +
+

Hello World!

+
+
+
+
+
+
+ + diff --git a/tests/resources/complexTrackerTestExample.html b/tests/resources/complexTrackerTestExample.html new file mode 100644 index 000000000..3a531651f --- /dev/null +++ b/tests/resources/complexTrackerTestExample.html @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + +
+

Hello World!

+
+
+
+
+
+
+ + diff --git a/tests/resources/trackerTestExample.html b/tests/resources/trackerTestExample.html new file mode 100644 index 000000000..b5688c04e --- /dev/null +++ b/tests/resources/trackerTestExample.html @@ -0,0 +1,49 @@ + + + + + + + + + + + +
+

Hello World!

+ +
+ + \ No newline at end of file From 310cc960c6bb6542353571815605ac32a696f2b8 Mon Sep 17 00:00:00 2001 From: Jacob Ransom Date: Fri, 10 May 2024 10:44:48 +1200 Subject: [PATCH 3/3] Adding one slight improvement back in --- Template/Tag/MatomoTag.web.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Template/Tag/MatomoTag.web.js b/Template/Tag/MatomoTag.web.js index 33501d5d0..4b1f262dd 100644 --- a/Template/Tag/MatomoTag.web.js +++ b/Template/Tag/MatomoTag.web.js @@ -193,7 +193,7 @@ if (matomoConfig.forceRequestMethod) { tracker.setRequestMethod(matomoConfig.requestMethod); - if(matomoConfig.requestMethod == 'POST'){ + if(matomoConfig.requestMethod.toUpperCase() === 'POST'){ tracker.setRequestContentType(matomoConfig.requestContentType); } }