Merge pull request #4391 from ethereum/fix_matomo_2

fix matomo
pull/4319/head
yann300 11 months ago committed by GitHub
commit 08d6bb7a81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/remix-ide/src/app/tabs/settings-tab.tsx
  2. 7
      apps/remix-ide/src/assets/js/loader.js
  3. 2
      libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx
  4. 2
      libs/remix-ui/app/src/lib/remix-app/remix-app.tsx
  5. 6
      libs/remix-ui/settings/src/lib/settingsAction.ts

@ -92,11 +92,9 @@ module.exports = class SettingsTab extends ViewPlugin {
this.config.set('settings/matomo-analytics', isChecked)
this.useMatomoAnalytics = isChecked
if (!isChecked) {
_paq.push(['optUserOut'])
// revoke tracking consent
_paq.push(['forgetConsentGiven']);
} else {
_paq.push(['forgetUserOptOut'])
// user has given consent to process their data
_paq.push(['setConsentGiven']);
}

@ -18,17 +18,14 @@ if (domains[window.location.hostname]) {
_paq.push(["setExcludedQueryParams", ["code","gist"]]);
_paq.push(["setExcludedReferrers", ["etherscan.io"]]);
_paq.push(['enableJSErrorTracking']);
// require user tracking consent before processing data
_paq.push(['requireConsent']);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
_paq.push(['enableHeartBeatTimer']);
if (!window.localStorage.getItem('config-v0.8:.remix.config') ||
(window.localStorage.getItem('config-v0.8:.remix.config') && !window.localStorage.getItem('config-v0.8:.remix.config').includes('settings/matomo-analytics'))) {
_paq.push(['optUserOut'])
// require user tracking consent before processing data
_paq.push(['requireConsent']);
} else {
_paq.push(['forgetUserOptOut'])
// user has given consent to process their data
_paq.push(['setConsentGiven'])
}

@ -61,14 +61,12 @@ const MatomoDialog = (props: MatomoDialogProps) => {
const declineModal = async () => {
settings.updateMatomoAnalyticsChoice(false)
_paq.push(['optUserOut'])
// revoke tracking consent
_paq.push(['forgetConsentGiven']);
setVisible(false)
}
const handleModalOkClick = async () => {
_paq.push(['forgetUserOptOut'])
// user has given consent to process their data
_paq.push(['setConsentGiven']);
settings.updateMatomoAnalyticsChoice(true)

@ -123,7 +123,7 @@ const RemixApp = (props: IRemixAppUi) => {
break
}
case UsageTypes.Advance: {
_paq.push(['trackEvent', 'enterDialog', 'usageType', 'tutor'])
_paq.push(['trackEvent', 'enterDialog', 'usageType', 'advanced'])
break
}
case UsageTypes.Prototyper: {

@ -43,9 +43,11 @@ export const useMatomoAnalytics = (config, checked, dispatch) => {
config.set('settings/matomo-analytics', checked)
dispatch({ type: 'useMatomoAnalytics', payload: { isChecked: checked, textClass: checked ? textDark : textSecondary } })
if (checked) {
_paq.push(['forgetUserOptOut'])
// user has given consent to process their data
_paq.push(['setConsentGiven']);
} else {
_paq.push(['optUserOut'])
// revoke tracking consent
_paq.push(['forgetConsentGiven']);
}
}

Loading…
Cancel
Save