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 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>
|
||||
|
||||
|
||||
@@ -29,4 +29,4 @@
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -59,6 +59,11 @@
|
||||
|
||||
// Set up posthog
|
||||
initPosthog();
|
||||
|
||||
// Disable umami on localhost
|
||||
if (dev) {
|
||||
localStorage.setItem('umami.disabled', '1');
|
||||
}
|
||||
}
|
||||
|
||||
function setAnalyticsUser() {
|
||||
|
||||
Reference in New Issue
Block a user