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.
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.
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.