beyonk-group / svelte-google-analytics

Google Analytics component for Svelte
77 stars 12 forks source link

feat(core): verify if gaMeasurementId is defined #2

Closed hmaesta closed 3 years ago

hmaesta commented 3 years ago

Added a simple verification to avoid loading Google Analytics if gaMeasurementId is not defined.

Must be updated in the future if supporting multiple IDs.

antony commented 3 years ago

Hey! Thanks for the PR. We won't merge this because I feel like it is defensive code. What we will do is add an enabled prop to the component, where you can add any logic required to disable/enable analytics :)

hmaesta commented 3 years ago

Thank's for the feedback, Antony. Indeed I am super defensive with Javascript 😂

Thank you for the great work, guys.