mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
chore(analytics): add tracking for task mirroring preference
This commit is contained in:
@@ -176,6 +176,7 @@ import dailyIcon from '@/assets/svg/daily.svg';
|
|||||||
import todoIcon from '@/assets/svg/todo.svg';
|
import todoIcon from '@/assets/svg/todo.svg';
|
||||||
import rewardIcon from '@/assets/svg/reward.svg';
|
import rewardIcon from '@/assets/svg/reward.svg';
|
||||||
|
|
||||||
|
import * as Analytics from '@/libs/analytics';
|
||||||
import { mapState } from '@/libs/store';
|
import { mapState } from '@/libs/store';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -410,6 +411,16 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
changeMirrorPreference (newVal) {
|
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', {
|
this.$store.dispatch('user:set', {
|
||||||
'preferences.tasks.mirrorGroupTasks': newVal,
|
'preferences.tasks.mirrorGroupTasks': newVal,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user