@@ -4,12 +4,16 @@ const domains = {
4
4
'remix.ethereum.org' : 23 ,
5
5
'localhost' : 35 // remix desktop
6
6
}
7
+ const domainsOnPrem = {
8
+ 'remix-alpha.ethereum.org' : 1
9
+ }
7
10
8
11
let domainToTrack = domains [ window . location . hostname ]
12
+ let domainOnPremToTrack = domainsOnPrem [ window . location . hostname ]
9
13
10
14
11
- function trackDomain ( domainToTrack ) {
12
- var _paq = window . _paq = window . _paq || [ ]
15
+ function trackDomain ( domainToTrack , u , paqName ) {
16
+ var _paq = window [ paqName ] = window [ paqName ] || [ ]
13
17
14
18
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
15
19
_paq . push ( [ "setExcludedQueryParams" , [ "code" , "gist" ] ] ) ;
@@ -22,11 +26,10 @@ function trackDomain(domainToTrack) {
22
26
_paq . push ( [ 'requireCookieConsent' ] ) ;
23
27
_paq . push ( [ 'trackEvent' , 'loader' , 'load' ] ) ;
24
28
( function ( ) {
25
- var u = "https://ethereumfoundation.matomo.cloud/" ;
26
29
_paq . push ( [ 'setTrackerUrl' , u + 'matomo.php?debug=1' ] ) ;
27
30
_paq . push ( [ 'setSiteId' , domainToTrack ] ) ;
28
31
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 ) ;
30
33
} ) ( ) ;
31
34
}
32
35
@@ -51,7 +54,19 @@ if (window.electronAPI) {
51
54
} )
52
55
} else {
53
56
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' )
55
70
}
56
71
}
57
72
function isElectron ( ) {
0 commit comments