Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analytics event: RIGHT_CLICK_IMAGE #1156

Merged
merged 18 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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