@@ -4,12 +4,19 @@ const domains = {
44 'remix.ethereum.org' : 23 ,
55 'localhost' : 35 // remix desktop
66}
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+ }
713
814let domainToTrack = domains [ window . location . hostname ]
15+ let domainOnPremToTrack = domainsOnPrem [ window . location . hostname ]
916
1017
11- function trackDomain ( domainToTrack ) {
12- var _paq = window . _paq = window . _paq || [ ]
18+ function trackDomain ( domainToTrack , u , paqName ) {
19+ var _paq = window [ paqName ] = window [ paqName ] || [ ]
1320
1421 /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
1522 _paq . push ( [ "setExcludedQueryParams" , [ "code" , "gist" ] ] ) ;
@@ -22,11 +29,17 @@ function trackDomain(domainToTrack) {
2229 _paq . push ( [ 'requireCookieConsent' ] ) ;
2330 _paq . push ( [ 'trackEvent' , 'loader' , 'load' ] ) ;
2431 ( function ( ) {
25- var u = "https://ethereumfoundation.matomo.cloud/" ;
2632 _paq . push ( [ 'setTrackerUrl' , u + 'matomo.php?debug=1' ] ) ;
2733 _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+
2841 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 ) ;
3043 } ) ( ) ;
3144}
3245
@@ -50,8 +63,8 @@ if (window.electronAPI) {
5063 }
5164 } )
5265} else {
53- if ( domainToTrack ) {
54- trackDomain ( domainToTrack )
66+ if ( domainOnPremToTrack ) {
67+ trackDomain ( domainOnPremToTrack , 'https://matomo.remix.live/matomo/' , '_paq' )
5568 }
5669}
5770function isElectron ( ) {
0 commit comments