Skip to content

Commit 0a3143a

Browse files
yann300Aniket-Engg
authored andcommitted
fix matomo
1 parent b0f6e0a commit 0a3143a

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

apps/remix-ide/src/app/tabs/settings-tab.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,9 @@ module.exports = class SettingsTab extends ViewPlugin {
9292
this.config.set('settings/matomo-analytics', isChecked)
9393
this.useMatomoAnalytics = isChecked
9494
if (!isChecked) {
95-
_paq.push(['optUserOut'])
9695
// revoke tracking consent
9796
_paq.push(['forgetConsentGiven']);
9897
} else {
99-
_paq.push(['forgetUserOptOut'])
10098
// user has given consent to process their data
10199
_paq.push(['setConsentGiven']);
102100
}

apps/remix-ide/src/assets/js/loader.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@ if (domains[window.location.hostname]) {
1818
_paq.push(["setExcludedQueryParams", ["code","gist"]]);
1919
_paq.push(["setExcludedReferrers", ["etherscan.io"]]);
2020
_paq.push(['enableJSErrorTracking']);
21-
// require user tracking consent before processing data
22-
_paq.push(['requireConsent']);
2321
_paq.push(['trackPageView']);
2422
_paq.push(['enableLinkTracking']);
2523
_paq.push(['enableHeartBeatTimer']);
2624
if (!window.localStorage.getItem('config-v0.8:.remix.config') ||
2725
(window.localStorage.getItem('config-v0.8:.remix.config') && !window.localStorage.getItem('config-v0.8:.remix.config').includes('settings/matomo-analytics'))) {
28-
_paq.push(['optUserOut'])
29-
26+
// require user tracking consent before processing data
27+
_paq.push(['requireConsent']);
3028
} else {
31-
_paq.push(['forgetUserOptOut'])
3229
// user has given consent to process their data
3330
_paq.push(['setConsentGiven'])
3431
}

libs/remix-ui/app/src/lib/remix-app/components/modals/matomo.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,12 @@ const MatomoDialog = (props: MatomoDialogProps) => {
6161

6262
const declineModal = async () => {
6363
settings.updateMatomoAnalyticsChoice(false)
64-
_paq.push(['optUserOut'])
6564
// revoke tracking consent
6665
_paq.push(['forgetConsentGiven']);
6766
setVisible(false)
6867
}
6968

7069
const handleModalOkClick = async () => {
71-
_paq.push(['forgetUserOptOut'])
7270
// user has given consent to process their data
7371
_paq.push(['setConsentGiven']);
7472
settings.updateMatomoAnalyticsChoice(true)

libs/remix-ui/app/src/lib/remix-app/remix-app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const RemixApp = (props: IRemixAppUi) => {
123123
break
124124
}
125125
case UsageTypes.Advance: {
126-
_paq.push(['trackEvent', 'enterDialog', 'usageType', 'tutor'])
126+
_paq.push(['trackEvent', 'enterDialog', 'usageType', 'advanced'])
127127
break
128128
}
129129
case UsageTypes.Prototyper: {

libs/remix-ui/settings/src/lib/settingsAction.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ export const useMatomoAnalytics = (config, checked, dispatch) => {
4343
config.set('settings/matomo-analytics', checked)
4444
dispatch({ type: 'useMatomoAnalytics', payload: { isChecked: checked, textClass: checked ? textDark : textSecondary } })
4545
if (checked) {
46-
_paq.push(['forgetUserOptOut'])
46+
// user has given consent to process their data
47+
_paq.push(['setConsentGiven']);
4748
} else {
48-
_paq.push(['optUserOut'])
49+
// revoke tracking consent
50+
_paq.push(['forgetConsentGiven']);
4951
}
5052
}
5153

0 commit comments

Comments
 (0)