From 8fdef5e648fba4641fc99df10947030ee833eeaa Mon Sep 17 00:00:00 2001 From: akhuoa Date: Thu, 21 Aug 2025 15:58:46 +1200 Subject: [PATCH 1/5] Emit copy clipboard click event --- src/components/CopyToClipboard/CopyToClipboard.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/CopyToClipboard/CopyToClipboard.vue b/src/components/CopyToClipboard/CopyToClipboard.vue index 9aff115..d36372e 100644 --- a/src/components/CopyToClipboard/CopyToClipboard.vue +++ b/src/components/CopyToClipboard/CopyToClipboard.vue @@ -94,8 +94,10 @@ export default { if (copiedSuccessfully) { this.textLabel = LABEL_AFTER; + this.$emit('copied', {status: 'success'}); } else { this.textLabel = 'Error trying to copy to clipboard!'; + this.$emit('copied', {status: 'error'}); } }, resetSettings: function () { From 112a6acac687a350a19f0c9cb8ce115c11a5cbad Mon Sep 17 00:00:00 2001 From: akhuoa Date: Fri, 22 Aug 2025 15:37:22 +1200 Subject: [PATCH 2/5] Add event tracking for annotation copy --- src/components/Tooltip/AnnotationPopup.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/Tooltip/AnnotationPopup.vue b/src/components/Tooltip/AnnotationPopup.vue index 24e65c0..394b10e 100644 --- a/src/components/Tooltip/AnnotationPopup.vue +++ b/src/components/Tooltip/AnnotationPopup.vue @@ -30,7 +30,7 @@
Feature Annotations
- +
@@ -68,7 +68,7 @@ @show-related-connectivities="showRelatedConnectivities" /> - +
  • @@ -79,7 +79,7 @@ @show-related-connectivities="showRelatedConnectivities" /> - +
  • @@ -546,6 +546,42 @@ export default { throw new Error(error); } }, + onCopied: function (event, reference) { + let category = 'Reference List'; + let doi = ''; + let citationType = this.citationType; + + if (reference) { + category = reference.resource; + doi = reference.type === 'doi' ? reference.id : ''; + } else { + const combinedResources = [ + ...this.pubMedReferences, + ...this.openLibReferences, + ...this.isbnDBReferences + ]; + const formattedResources = combinedResources.map((resource) => { + if (resource.type === 'doi') { + return resource.id; + } else { + return resource.resource; + } + }); + + category = formattedResources.join(', '); + } + + const taggingData = { + 'event': 'interaction_event', + 'event_name': `portal_maps_copy_citation`, + 'category': category, + 'doi': doi, + 'citation_type': citationType, + 'location': 'map_connectivity_references', + }; + + this.$emit('trackEvent', taggingData); + }, }, } From 683e38b4a445dd6719b651b4bec340eda580ddc0 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Mon, 25 Aug 2025 16:30:36 +1200 Subject: [PATCH 4/5] Add event tracking for show related connectivities in references --- src/components/Tooltip/ExternalResourceCard.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/Tooltip/ExternalResourceCard.vue b/src/components/Tooltip/ExternalResourceCard.vue index 66b91ad..352b3b5 100644 --- a/src/components/Tooltip/ExternalResourceCard.vue +++ b/src/components/Tooltip/ExternalResourceCard.vue @@ -154,6 +154,15 @@ export default { methods: { showRelatedConnectivities: function (resource) { this.$emit('show-reference-connectivities', resource); + + const taggingData = { + 'event': 'interaction_event', + 'event_name': `portal_maps_show_related_connectivities`, + 'category': resource, + 'location': 'map_connectivity_references', + }; + + this.$emit('trackEvent', taggingData); }, formatReferences: function (references) { const nonPubMedReferences = this.extractNonPubMedReferences(references); From c87fa45ea558dc67775c52b52fd965fcee71e3ce Mon Sep 17 00:00:00 2001 From: akhuoa Date: Mon, 25 Aug 2025 17:20:58 +1200 Subject: [PATCH 5/5] Update event tracking data for annoation --- src/components/Tooltip/AnnotationPopup.vue | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/components/Tooltip/AnnotationPopup.vue b/src/components/Tooltip/AnnotationPopup.vue index 394b10e..962d35d 100644 --- a/src/components/Tooltip/AnnotationPopup.vue +++ b/src/components/Tooltip/AnnotationPopup.vue @@ -271,12 +271,26 @@ export default { if (this.entryIndex !== 0) { this.entryIndex = this.entryIndex - 1; this.emitActiveItemChange(); + + const data = this.annotationEntry[this.entryIndex]; + const taggingData = { + 'event_name': `portal_maps_annotation_previous`, + 'category': String(data?.featureId || ''), + }; + this.trackEvent(taggingData); } }, next: function () { if (this.entryIndex !== this.annotationEntry.length - 1) { this.entryIndex = this.entryIndex + 1; this.emitActiveItemChange(); + + const data = this.annotationEntry[this.entryIndex]; + const taggingData = { + 'event_name': `portal_maps_annotation_next`, + 'category': String(data?.featureId || ''), + }; + this.trackEvent(taggingData); } }, emitActiveItemChange: function () { @@ -492,11 +506,13 @@ export default { return contentArray.join('\n\n
    '); }, onCopied: function () { - const data = { - 'event_name': `portal_maps_annotation`, - 'category': 'copy_content', + const data = this.annotationEntry[this.entryIndex]; + const taggingData = { + 'event_name': `portal_maps_annotation_copy_content`, + 'category': String(data?.featureId || ''), }; - this.trackEvent(data); + + this.trackEvent(taggingData); }, trackEvent: function (data) { const taggingData = {