@@ -4,12 +4,19 @@ 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
+ 'remix-beta.ethereum.org' : 2 ,
10
+ 'remix.ethereum.org' : 3 ,
11
+ 'localhost' : 4 // remix desktop
12
+ }
7
13
8
14
let domainToTrack = domains [ window . location . hostname ]
15
+ let domainOnPremToTrack = domainsOnPrem [ window . location . hostname ]
9
16
10
17
11
- function trackDomain ( domainToTrack ) {
12
- var _paq = window . _paq = window . _paq || [ ]
18
+ function trackDomain ( domainToTrack , u , paqName ) {
19
+ var _paq = window [ paqName ] = window [ paqName ] || [ ]
13
20
14
21
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
15
22
_paq . push ( [ "setExcludedQueryParams" , [ "code" , "gist" ] ] ) ;
@@ -22,11 +29,17 @@ function trackDomain(domainToTrack) {
22
29
_paq . push ( [ 'requireCookieConsent' ] ) ;
23
30
_paq . push ( [ 'trackEvent' , 'loader' , 'load' ] ) ;
24
31
( function ( ) {
25
- var u = "https://ethereumfoundation.matomo.cloud/" ;
26
32
_paq . push ( [ 'setTrackerUrl' , u + 'matomo.php?debug=1' ] ) ;
27
33
_paq . push ( [ 'setSiteId' , domainToTrack ] ) ;
34
+
35
+ if ( domainToTrack ) {
36
+ const secondaryTrackerUrl = 'https://ethereumfoundation.matomo.cloud/'
37
+ const secondaryWebsiteId = domainToTrack
38
+ _paq . push ( [ 'addTracker' , secondaryTrackerUrl , secondaryWebsiteId ] )
39
+ }
40
+
28
41
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 ) ;
42
+ g . async = true ; g . src = u + ' matomo.js'; s . parentNode . insertBefore ( g , s ) ;
30
43
} ) ( ) ;
31
44
}
32
45
@@ -50,8 +63,8 @@ if (window.electronAPI) {
50
63
}
51
64
} )
52
65
} else {
53
- if ( domainToTrack ) {
54
- trackDomain ( domainToTrack )
66
+ if ( domainOnPremToTrack ) {
67
+ trackDomain ( domainOnPremToTrack , 'https://matomo.remix.live/matomo/' , '_paq' )
55
68
}
56
69
}
57
70
function isElectron ( ) {
0 commit comments