feat: disable umami analytics on localhost for dashboard and classroomio-com (#505)

* feat: dsiable umami analytics on dashboard and landing page

* feat: disable umami on localhost

* re-add space

* move disabling umami to setupAnalytics function

* remove whitespace

* add comment

---------

Co-authored-by: Rotimi Best <best@classroomio.com>
This commit is contained in:
Iniubong Obonguko
2024-10-20 02:03:37 +01:00
committed by GitHub
co-authored by Rotimi Best
parent e3e466232e
commit c16d036cc3
3 changed files with 14 additions and 1 deletions
@@ -6,11 +6,19 @@
import PageTransition from './transition.svelte';
import NotFound from '$lib/NotFound/NotFound.svelte';
import extend from 'just-extend';
import { dev } from '$app/environment';
import { onMount } from 'svelte';
import '../app.css';
export let data;
onMount(() => {
if (dev) {
localStorage.setItem('umami.disabled', '1');
}
});
$: metaTags = extend(true, {}, data.baseMetaTags, $page.data.pageMetaTags);
</script>
+1 -1
View File
@@ -29,4 +29,4 @@
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
</html>
+5
View File
@@ -59,6 +59,11 @@
// Set up posthog
initPosthog();
// Disable umami on localhost
if (dev) {
localStorage.setItem('umami.disabled', '1');
}
}
function setAnalyticsUser() {