Skip to content

Commit d553f90

Browse files
authored
Merge pull request #6205 from ethereum/yann300-patch-63
Update loader.js
2 parents 28e315d + 6efbd81 commit d553f90

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

apps/remix-ide/src/assets/js/loader.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ function trackDomain(domainToTrack, u, paqName) {
2828
(function () {
2929
_paq.push(['setTrackerUrl', u + 'matomo.php?debug=1']);
3030
_paq.push(['setSiteId', domainToTrack]);
31+
32+
if (domainToTrack) {
33+
const secondaryTrackerUrl = 'https://ethereumfoundation.matomo.cloud/'
34+
const secondaryWebsiteId = domainToTrack
35+
_paq.push(['addTracker', secondaryTrackerUrl, secondaryWebsiteId])
36+
}
37+
3138
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
3239
g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s);
3340
})();
@@ -53,20 +60,8 @@ if (window.electronAPI) {
5360
}
5461
})
5562
} else {
56-
if (domainToTrack) {
57-
trackDomain(domainToTrack, 'https://ethereumfoundation.matomo.cloud/', '_paq')
58-
// Override push method
59-
window._paq.push = function (...args) {
60-
// Push to the original _paq
61-
const result = originalPush.apply(this, args)
62-
63-
// Also replicate to other trackers
64-
if (window._paq2) window._paq2.push(...args)
65-
return result;
66-
}
67-
}
6863
if (domainOnPremToTrack) {
69-
trackDomain(domainOnPremToTrack, 'https://matomo.remix.live/matomo/', '_paq2')
64+
trackDomain(domainOnPremToTrack, 'https://matomo.remix.live/matomo/', '_paq')
7065
}
7166
}
7267
function isElectron() {

0 commit comments

Comments
 (0)