chore(analytics): add tracking for task mirroring preference

This commit is contained in:
SabreCat
2022-07-05 15:10:36 -05:00
parent 9453b1269e
commit 7b067de4b9

View File

@@ -176,6 +176,7 @@ import dailyIcon from '@/assets/svg/daily.svg';
import todoIcon from '@/assets/svg/todo.svg';
import rewardIcon from '@/assets/svg/reward.svg';
import * as Analytics from '@/libs/analytics';
import { mapState } from '@/libs/store';
export default {
@@ -410,6 +411,16 @@ export default {
return false;
},
changeMirrorPreference (newVal) {
Analytics.track({
eventName: 'mirror tasks',
eventAction: 'mirror tasks',
eventCategory: 'behavior',
hitType: 'event',
mirror: newVal,
}, { trackOnClient: true });
Analytics.updateUser({
mirrorTasks: newVal,
});
this.$store.dispatch('user:set', {
'preferences.tasks.mirrorGroupTasks': newVal,
});