Open iron-cherep opened 1 year ago
I tried to check the code, but I cannot see why this snippet is being included. But this is kind of breaking the Google Pagespeed score as well 😅
I will try to dig a little deeper tonight see if I can fix it.
Same issue for me. I am trying to use the Umami component but I see Amplitude errors in console and network tab on website. Not sure why it is being included by default.
I checked it a while ago, it seems like the original JavaScript code from Amplitude auto injects itself in some way. But this would mean every time an update comes out, that we need to manually edit the code that they use if we try to change it our-self.
Eventually I switched away from astro-analytics, as this cannot be solved without modifying the code from Amplitude itself.
I tried importing the analytics directly from src/foo.astro but it wouldnt let me. The problem arises because the index.ts imports / exports all astro components. If we could import the component we need directly, it would work
same issue , when i want to use only google analytics and i had an error on the console that i miss an api key for amplitude
Issue:
When using Google Analytics through
astro-analytics
, an unexpected Amplitude Analytics snippet is also being includedRepo with reproduction:
Included Google Analytics component: https://github.com/iron-cherep/astro-analytics-repro/blob/23314b745c3af5c326851746441d03e2b353ef47/src/pages/index.astro#L16
Amplitude snippet in resulting build: https://github.com/iron-cherep/astro-analytics-repro/blob/23314b745c3af5c326851746441d03e2b353ef47/dist/index.html#L9