fix(analytics): move lfp events out of mounted

This commit is contained in:
SabreCat
2023-05-02 16:52:50 -05:00
parent 13e87b1ea0
commit c77dd5f200
4 changed files with 17 additions and 14 deletions

View File

@@ -264,12 +264,6 @@ export default {
},
mounted () {
this.seeking = Boolean(this.user.party.seeking);
Analytics.track({
eventName: 'Start a Party button',
eventAction: 'Start a Party button',
eventCategory: 'behavior',
hitType: 'event',
}, { trackOnClient: true });
},
methods: {
async createParty () {

View File

@@ -243,8 +243,6 @@ import rogueIcon from '@/assets/svg/rogue.svg';
import healerIcon from '@/assets/svg/healer.svg';
import wizardIcon from '@/assets/svg/wizard.svg';
import * as Analytics from '@/libs/analytics';
export default {
components: {
Avatar,
@@ -287,12 +285,6 @@ export default {
section: this.$t('lookingForPartyTitle'),
});
this.seekers = await this.$store.dispatch('party:lookingForParty');
await Analytics.track({
hitType: 'event',
eventName: 'View Find Members',
eventAction: 'View Find Members',
eventCategory: 'behavior',
}, { trackOnClient: true });
this.canLoadMore = this.seekers.length === 30;
this.loading = false;
}

View File

@@ -122,6 +122,7 @@
<script>
import orderBy from 'lodash/orderBy';
import * as Analytics from '@/libs/analytics';
import { mapGetters, mapActions } from '@/libs/store';
import MemberDetails from '../memberDetails';
import createPartyModal from '../groups/createPartyModal';
@@ -237,6 +238,12 @@ export default {
this.$router.push('/looking-for-party');
} else {
this.$root.$emit('bv::show::modal', 'create-party-modal');
Analytics.track({
eventName: 'Start a Party button',
eventAction: 'Start a Party button',
eventCategory: 'behavior',
hitType: 'event',
}, { trackOnClient: true });
}
},
loadMembers (payload = null) {

View File

@@ -1,5 +1,6 @@
import Vue from 'vue';
import VueRouter from 'vue-router';
import * as Analytics from '@/libs/analytics';
import getStore from '@/store';
import handleRedirect from './handleRedirect';
@@ -439,6 +440,15 @@ router.beforeEach(async (to, from, next) => {
router.app.$root.$emit('update-party');
}
if (to.name === 'lookingForParty') {
Analytics.track({
hitType: 'event',
eventName: 'View Find Members',
eventAction: 'View Find Members',
eventCategory: 'behavior',
}, { trackOnClient: true });
}
// Redirect old guild urls
if (to.hash.indexOf('#/options/groups/guilds/') !== -1) {
const splits = to.hash.split('/');