Skip to content

Commit e6078fa

Browse files
committed
set matomo vars
1 parent b5b0e5b commit e6078fa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useContext, useEffect, useRef, useState } from 'react'
22
import { FormattedMessage } from 'react-intl'
33
import { useDialogDispatchers } from '../../context/provider'
4-
import { CustomTooltip } from "@remix-ui/helper"
54
import { ToggleSwitch } from '@remix-ui/toggle'
65
import { AppContext } from '../../context/context'
76
declare global {
@@ -115,9 +114,18 @@ const ManagePreferencesDialog = (props) => {
115114
}, [visible])
116115

117116
const savePreferences = async () => {
117+
_paq.push(['setConsentGiven']) // default consent to process their anonymous data
118118
settings.updateMatomoAnalyticsChoice(true) // Always true for matomo Anonymous analytics
119119
settings.updateMatomoPerfAnalyticsChoice(switcherState.current.matPerfSwitch) // Enable/Disable Matomo Performance analytics
120+
if (switcherState.current.matPerfSwitch) {
121+
// user has given consent to process their performance data
122+
_paq.push(['setMatomoPerfConsentGiven'])
123+
} else {
124+
// revoke tracking consent for performance data
125+
_paq.push(['forgetMatomoPerfConsentGiven'])
126+
}
120127
settings.updateCopilotChoice(switcherState.current.remixAISwitch) // Enable/Disable RemixAI copilot
128+
setVisible(false)
121129
props.savePreferencesFn()
122130
}
123131

0 commit comments

Comments
 (0)