chore: Update analytics events (#6050)

This commit is contained in:
Pranav Raj S
2022-12-08 20:53:13 -08:00
committed by GitHub
parent 7dc790a7e0
commit 6200559123
17 changed files with 1108 additions and 55 deletions

View File

@@ -35,6 +35,9 @@
import alertMixin from 'shared/mixins/alertMixin';
import { mixin as clickaway } from 'vue-clickaway';
import MacroPreview from './MacroPreview';
import AnalyticsHelper, {
ANALYTICS_EVENTS,
} from '../../../../helper/AnalyticsHelper';
export default {
components: {
MacroPreview,
@@ -64,6 +67,7 @@ export default {
macroId: macro.id,
conversationIds: [this.conversationId],
});
AnalyticsHelper.track(ANALYTICS_EVENTS.EXECUTED_A_MACRO);
this.showAlert(this.$t('MACROS.EXECUTE.EXECUTED_SUCCESSFULLY'));
} catch (error) {
this.showAlert(this.$t('MACROS.ERROR'));

View File

@@ -7,6 +7,7 @@ import dashboard from './dashboard/dashboard.routes';
import login from './login/login.routes';
import store from '../store';
import { validateLoggedInRoutes } from '../helper/routeHelpers';
import AnalyticsHelper from '../helper/AnalyticsHelper';
const routes = [...login.routes, ...dashboard.routes, ...authRoute.routes];
@@ -117,6 +118,11 @@ export const validateRouteAccess = (to, from, next, { getters }) => {
export const initalizeRouter = () => {
const userAuthentication = store.dispatch('setUser');
router.beforeEach((to, from, next) => {
AnalyticsHelper.page(to.name || '', {
path: to.path,
name: to.name,
});
if (validateSSOLoginParams(to)) {
clearBrowserSessionCookies();
next();