const environment = 'production'; const siteId = environment === 'production' ? 4: 2; let _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ if(_paq && environment.length > 0 && environment !== 'dev'){ try { _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { let u="//analytics.soapboxx.com/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', siteId]); let d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); console.info(`Matomo was loaded for environment ${environment} siteId ${siteId}`); })(); } catch(e) { console.error('error initializing Matomo tracking', e); } } else { let _paq = []; console.warn(`Matomo was not loaded for environment ${environment} siteId ${siteId}`); } let _mtm = window._mtm = window._mtm || []; const userId = document.userInstance.getUserId(); if (userId) { _paq.push(['setUserId', userId]); window._mtm.push({'uid': userId}); console.log(`uid variable sent ${userId}`); } _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'}); (function() { const containerId = environment === 'staging' ? 'container_OfggstuZ' : 'container_dzuhy9So'; let d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=`https://analytics.soapboxx.com/js/${containerId}.js`; s.parentNode.insertBefore(g,s); })(); if(Sentry && environment.length > 0 && environment !== 'dev'){ try { Sentry.init({ dsn: "https://4debe041e10049609b97c680d04b0711@bugsink.soapboxx.com/1", // Adds request headers and IP for users, for more info visit: // https://docs.sentry.io/platforms/javascript/configuration/options/#sendDefaultPii sendDefaultPii: true, environment: environment, // Alternatively, use `process.env.npm_package_version` for a dynamic release version // if your build tool supports it. release: "usersite-bridge@2.4", }); console.info(`sentry initialized for ${environment} environment`); } catch(e) { console.error('error initializing sentry SDK', e); } } else { console.warn(`Sentry SDK was not loaded for ${environment} environment`); } -->