diff --git a/app/javascript/dashboard/components/widgets/conversation/ConversationAdvancedFilter.vue b/app/javascript/dashboard/components/widgets/conversation/ConversationAdvancedFilter.vue index 34a349fff..b70026cb0 100644 --- a/app/javascript/dashboard/components/widgets/conversation/ConversationAdvancedFilter.vue +++ b/app/javascript/dashboard/components/widgets/conversation/ConversationAdvancedFilter.vue @@ -61,6 +61,7 @@ import { mapGetters } from 'vuex'; import { filterAttributeGroups } from './advancedFilterItems'; import filterMixin from 'shared/mixins/filterMixin'; import * as OPERATORS from 'dashboard/components/widgets/FilterInput/FilterOperatorTypes.js'; +import { CONVERSATION_EVENTS } from '../../../helper/AnalyticsHelper/events'; export default { components: { @@ -287,6 +288,12 @@ export default { JSON.parse(JSON.stringify(this.appliedFilters)) ); this.$emit('applyFilter', this.appliedFilters); + this.$track(CONVERSATION_EVENTS.APPLY_FILTER, { + applied_filters: this.appliedFilters.map(filter => ({ + key: filter.attribute_key, + operator: filter.filter_operator, + })), + }); }, resetFilter(index, currentFilter) { this.appliedFilters[index].filter_operator = this.filterTypes.find( diff --git a/app/javascript/dashboard/helper/AnalyticsHelper/events.js b/app/javascript/dashboard/helper/AnalyticsHelper/events.js index 3d8b0f901..2b8085e97 100644 --- a/app/javascript/dashboard/helper/AnalyticsHelper/events.js +++ b/app/javascript/dashboard/helper/AnalyticsHelper/events.js @@ -4,6 +4,8 @@ export const CONVERSATION_EVENTS = Object.freeze({ SENT_PRIVATE_NOTE: 'Sent a private note', INSERTED_A_CANNED_RESPONSE: 'Inserted a canned response', USED_MENTIONS: 'Used mentions', + + APPLY_FILTER: 'Applied filters in the conversation list', }); export const ACCOUNT_EVENTS = Object.freeze({