From 77e4d5011e71640f3da96f96011706c1d56989ef Mon Sep 17 00:00:00 2001 From: Sasha Zoria Date: Tue, 6 Jun 2023 18:46:21 +0300 Subject: [PATCH] Analytics event: RIGHT_CLICK_IMAGE (#1156) * extended event type by adding right click image event --------- Co-authored-by: Oleksandr.Zoria Co-authored-by: Olga Bulat Co-authored-by: Zack Krida --- frontend/src/pages/image/_id/index.vue | 8 ++++++++ frontend/src/types/analytics.ts | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/frontend/src/pages/image/_id/index.vue b/frontend/src/pages/image/_id/index.vue index b2fc088b082..325c1c6e6ba 100644 --- a/frontend/src/pages/image/_id/index.vue +++ b/frontend/src/pages/image/_id/index.vue @@ -15,6 +15,7 @@ :height="imageHeight" @load="onImageLoaded" @error="onImageError" + @contextmenu="handleRightClick(image.identifier)" /> { + sendCustomEvent("RIGHT_CLICK_IMAGE", { + identifier, + }) + } + const sendGetMediaEvent = () => { if (!image.value) { return @@ -228,6 +235,7 @@ export default defineComponent({ sketchFabUid, onImageLoaded, onImageError, + handleRightClick, backToSearchPath, sendGetMediaEvent, diff --git a/frontend/src/types/analytics.ts b/frontend/src/types/analytics.ts index 112541997d5..8a846497dfe 100644 --- a/frontend/src/types/analytics.ts +++ b/frontend/src/types/analytics.ts @@ -40,6 +40,15 @@ export type Events = { /** the identifier of the image */ identifier: string } + /** + * Description: The user right clicks a single image result, most likely to download it. + * Questions: + * - Do users right-click images often? Does this suggest downloading them directly, + * when not paired with a `GET_MEDIA` event? + */ + RIGHT_CLICK_IMAGE: { + identifier: string + } /** * Click on the 'back to search' link on a single result *