Skip to content

Commit dd85e49

Browse files
committed
use onprem matomo
1 parent 40d9bf1 commit dd85e49

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

apps/remix-ide-e2e/src/commands/verifyLoad.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import EventEmitter from 'events'
33

44
class VerifyLoad extends EventEmitter {
55
command(this: NightwatchBrowser) {
6-
browser.waitForElementPresent({
6+
browser.saveScreenshot('./reports/screenshots/verifyLoad.png').waitForElementPresent({
77
selector: "//span[@data-id='typesloaded']",
88
locateStrategy: 'xpath',
99
timeout: 60000

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

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ const domains = {
44
'remix.ethereum.org': 23,
55
'localhost': 35 // remix desktop
66
}
7+
const domainsOnPrem = {
8+
'remix-alpha.ethereum.org': 1
9+
}
710

811
let domainToTrack = domains[window.location.hostname]
12+
let domainOnPremToTrack = domainsOnPrem[window.location.hostname]
913

1014

11-
function trackDomain(domainToTrack) {
12-
var _paq = window._paq = window._paq || []
15+
function trackDomain(domainToTrack, u, paqName) {
16+
var _paq = window[paqName] = window[paqName] || []
1317

1418
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
1519
_paq.push(["setExcludedQueryParams", ["code", "gist"]]);
@@ -22,11 +26,10 @@ function trackDomain(domainToTrack) {
2226
_paq.push(['requireCookieConsent']);
2327
_paq.push(['trackEvent', 'loader', 'load']);
2428
(function () {
25-
var u = "https://ethereumfoundation.matomo.cloud/";
2629
_paq.push(['setTrackerUrl', u + 'matomo.php?debug=1']);
2730
_paq.push(['setSiteId', domainToTrack]);
2831
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
29-
g.async = true; g.src = 'https://cdn.matomo.cloud/ethereumfoundation.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g, s);
32+
g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s);
3033
})();
3134
}
3235

@@ -51,7 +54,19 @@ if (window.electronAPI) {
5154
})
5255
} else {
5356
if (domainToTrack) {
54-
trackDomain(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+
}
68+
if (domainOnPremToTrack) {
69+
trackDomain(domainOnPremToTrack, 'http://178.156.150.253/matomo/', '_paq2')
5570
}
5671
}
5772
function isElectron() {

0 commit comments

Comments
 (0)