Skip to content

Beautiful Open-Source Form Builder

Update ClarityLink and Clarity components to use user ID for identification (#911)

Chirag Chhatrala360e16382741
diff --git a/client/components/pages/admin/ClarityLink.vue b/client/components/pages/admin/ClarityLink.vue
index d7c761722..239b27d5d 100644
--- a/client/components/pages/admin/ClarityLink.vue
+++ b/client/components/pages/admin/ClarityLink.vue
@@ -17,6 +17,6 @@ const runtimeConfig = useRuntimeConfig()
const clarityProjectId = computed(() => runtimeConfig.public.clarityProjectId || null)
const clarityLink = computed(() => {
- return `https://clarity.microsoft.com/projects/view/${clarityProjectId.value}/impressions?CustomUserId=is%3B${props.user.email}`
+ return `https://clarity.microsoft.com/projects/view/${clarityProjectId.value}/impressions?CustomUserId=is%3B${props.user.id}`
})
</script>
\ No newline at end of file
diff --git a/client/components/vendor/Clarity.vue b/client/components/vendor/Clarity.vue
index 4dc17999b..f314a249f 100644
--- a/client/components/vendor/Clarity.vue
+++ b/client/components/vendor/Clarity.vue
@@ -19,7 +19,7 @@ async function loadClarity() {
try {
Clarity.init(projectId)
if (user.value?.id) {
- Clarity.identify(String(user.value.id), null, null, user.value.email)
+ Clarity.identify(String(user.value.id), null, null, String(user.value.id))
}
loaded.value = true
} catch (error) {
@@ -36,7 +36,7 @@ watch(user, (val) => {
if (!loaded.value || !isAuthenticated.value || isIframe) return
if (val?.id) {
try {
- Clarity.identify(String(val.id), null, null, val.email)
+ Clarity.identify(String(val.id), null, null, String(val.id))
} catch (error) {
console.error('[Clarity] Failed to identify user', error)
}