Disable Google Analytics tracker for dev and Google PageSpeed bot
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-13 10:28:42 +02:00
parent 3029c3c29f
commit 5a00c6f552
4 changed files with 50 additions and 38 deletions

View File

@@ -74,10 +74,10 @@
pageReady
} from 'utils/store'
// Components
import AnalyticsTracker from 'utils/AnalyticsTracker'
// Variables
const { page } = stores()
let AnalyticsTracker
/*
@@ -97,6 +97,12 @@
// Replace each location's country by the database
$locations.forEach(loc => loc.country = $countries.find(cont => cont.id === loc.country.id))
onMount(async () => {
const gaTracker = await import('utils/AnalyticsTracker')
AnalyticsTracker = gaTracker.default
})
</script>
<style lang="scss" global>
@@ -115,4 +121,4 @@
<slot></slot>
</main>
<AnalyticsTracker {stores} id={process.env.CONFIG.GA_TRACKER_ID} />
<svelte:component this={AnalyticsTracker} {stores} id={process.env.CONFIG.GA_TRACKER_ID} />