astro-analytics
astro-analytics copied to clipboard
apiKey undefined for Amplitude
For some reason, the apiKey prop isn't being passed through to the amplitude script properly.
I'm using TypeScript, so I'm wondering if the transpile step is losing context.
<!-- Layout.astro -->
<!-- ... -->
<!doctype html>
<html
lang="en"
transition:animate={fade({ duration: '1s' })}
>
<head>
<meta charset="UTF-8" />
<meta name="image" property="og:image" content={ SHARE_IMAGE }>
<meta name="description" content={ DESCRIPTION } />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{ pageTitle }</title>
<Amplitude apiKey="MY_REAL_KEY_OBVIOUSLY" />
<ViewTransitions />
</head>
<body>
<!-- ... -->
I think it also has to do with this issue that me and others spotted as well.
https://github.com/Destiner/astro-analytics/issues/25
It seems like the code from Amplitude always loads, regardless and I think that implementation is just broken.
I have the same issue