diff --git a/src/components/molecules/Switcher.svelte b/src/components/molecules/Switcher.svelte index 37d58d0..d12cb5d 100644 --- a/src/components/molecules/Switcher.svelte +++ b/src/components/molecules/Switcher.svelte @@ -6,6 +6,7 @@ import { page } from '$app/stores' import { getContext } from 'svelte' import reveal from '$animations/reveal' + import { sendEvent } from '$utils/analytics' // Components import Icon from '$components/atoms/Icon.svelte' @@ -20,6 +21,9 @@ */ const toggleSwitcher = () => { isOpen = !isOpen + + // Record opening event + !isOpen && sendEvent({ action: 'switcherOpen' }) } /** diff --git a/src/utils/functions/index.ts b/src/utils/functions/index.ts index 39f8bc6..6b34322 100644 --- a/src/utils/functions/index.ts +++ b/src/utils/functions/index.ts @@ -1,3 +1,6 @@ +import { sendEvent } from '$utils/analytics' + + /** * Throttle function */ @@ -150,6 +153,9 @@ export const mailtoClipboard = (node: HTMLElement) => { detail: { email: emailAddress } })) + // Record event in analytics + sendEvent({ action: 'emailCopy' }) + event.preventDefault() }