Skip to content

Commit

Permalink
Analytics event: RIGHT_CLICK_IMAGE (#1156)
Browse files Browse the repository at this point in the history
* extended event type by adding right click image event
---------

Co-authored-by: Oleksandr.Zoria <oleksandr.zoria@p2h.com>
Co-authored-by: Olga Bulat <obulat@gmail.com>
Co-authored-by: Zack Krida <zackkrida@pm.me>
  • Loading branch information
4 people authored Jun 6, 2023
1 parent 7804de6 commit 77e4d50
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/src/pages/image/_id/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:height="imageHeight"
@load="onImageLoaded"
@error="onImageError"
@contextmenu="handleRightClick(image.identifier)"
/>
<VSketchFabViewer
v-if="sketchFabUid"
Expand Down Expand Up @@ -204,6 +205,12 @@ export default defineComponent({
const { sendCustomEvent } = useAnalytics()
const handleRightClick = (identifier: string) => {
sendCustomEvent("RIGHT_CLICK_IMAGE", {
identifier,
})
}
const sendGetMediaEvent = () => {
if (!image.value) {
return
Expand All @@ -228,6 +235,7 @@ export default defineComponent({
sketchFabUid,
onImageLoaded,
onImageError,
handleRightClick,
backToSearchPath,
sendGetMediaEvent,
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/types/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit 77e4d50

Please sign in to comment.