Disable Google Analytics tracker for dev and Google PageSpeed bot
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user