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 <[email protected]>
This commit is contained in:
co-authored by
Rotimi Best
parent
e3e466232e
commit
c16d036cc3
@@ -6,11 +6,19 @@
|
|||||||
import PageTransition from './transition.svelte';
|
import PageTransition from './transition.svelte';
|
||||||
import NotFound from '$lib/NotFound/NotFound.svelte';
|
import NotFound from '$lib/NotFound/NotFound.svelte';
|
||||||
import extend from 'just-extend';
|
import extend from 'just-extend';
|
||||||
|
import { dev } from '$app/environment';
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
import '../app.css';
|
import '../app.css';
|
||||||
|
|
||||||
export let data;
|
export let data;
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
if (dev) {
|
||||||
|
localStorage.setItem('umami.disabled', '1');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$: metaTags = extend(true, {}, data.baseMetaTags, $page.data.pageMetaTags);
|
$: metaTags = extend(true, {}, data.baseMetaTags, $page.data.pageMetaTags);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,11 @@
|
|||||||
|
|
||||||
// Set up posthog
|
// Set up posthog
|
||||||
initPosthog();
|
initPosthog();
|
||||||
|
|
||||||
|
// Disable umami on localhost
|
||||||
|
if (dev) {
|
||||||
|
localStorage.setItem('umami.disabled', '1');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAnalyticsUser() {
|
function setAnalyticsUser() {
|
||||||
|
|||||||
Reference in New Issue
Block a user