umami is not defined - Tracking Event - Javascript #2437
-
Iam currently using the script tag in sveltekit head to integrate umami for tracking events with javascript, umami is not defined I tried to use ts ignore and svelte ignore for ignoring this error but nothing works. Any idea how to run the dev server again ? |
Beta Was this translation helpful? Give feedback.
Answered by
jonathan-martz
Dec 17, 2023
Replies: 1 comment
-
The Easy solution would be to check if umami is defined.
because i want to track the search query i checked if query is empty and query is min 3 chars long. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jonathan-martz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Easy solution would be to check if umami is defined.
if (umami) { umami.track((props) => ({ ...props, name: "search", data: { query: $query, }, })); }
because i want to track the search query i checked if query is empty and query is min 3 chars long.