diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 623a5707..1d760d8e 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -1266,6 +1266,11 @@ export default { if (this.$refs.pathwaysSelection) { this.$refs.pathwaysSelection.reset() } + + this.trackEvent({ + 'event_name': `portal_maps_zoom`, + 'category': 'reset', + }); } }, /** @@ -1276,6 +1281,11 @@ export default { zoomIn: function () { if (this.mapImp) { this.mapImp.zoomIn() + + this.trackEvent({ + 'event_name': `portal_maps_zoom`, + 'category': 'zoom_in', + }); } }, /** @@ -1286,6 +1296,11 @@ export default { zoomOut: function () { if (this.mapImp) { this.mapImp.zoomOut() + + this.trackEvent({ + 'event_name': `portal_maps_zoom`, + 'category': 'zoom_out', + }); } }, onSelectionsDataChanged: function (data) { @@ -3057,6 +3072,19 @@ export default { setConnectionType: function (type) { this.connectionType = type; }, + /** + * @public + * Function to track events. + * @arg {Object} `data` + */ + trackEvent: function (data) { + const taggingData = { + 'event': 'interaction_event', + 'location': 'flatmap', + ...data, + }; + this.$emit('trackEvent', taggingData); + }, }, props: { /** diff --git a/src/components/MultiFlatmapVuer.vue b/src/components/MultiFlatmapVuer.vue index 5f02943b..f810449a 100644 --- a/src/components/MultiFlatmapVuer.vue +++ b/src/components/MultiFlatmapVuer.vue @@ -91,6 +91,7 @@ :showLocalSettings="showLocalSettings" :showOpenMapButton="showOpenMapButton" :showPathwayFilter="showPathwayFilter" + @trackEvent="trackEvent" :externalLegends="externalLegends" /> @@ -566,6 +567,19 @@ export default { let map = this.getCurrentFlatmap(); map.setConnectionType(type); }, + /** + * @public + * Function to track events. + * @arg {Object} `data` + */ + trackEvent: function (data) { + const taggingData = { + 'event': 'interaction_event', + 'location': 'flatmap', + ...data, + }; + this.$emit('trackEvent', taggingData); + }, }, props: { /**