astro-analytics icon indicating copy to clipboard operation
astro-analytics copied to clipboard

apiKey undefined for Amplitude

Open davejsdev opened this issue 1 year ago • 2 comments

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>
	<!-- ... -->
image

davejsdev avatar Mar 08 '24 14:03 davejsdev

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.

nlxdodge avatar Apr 19 '24 08:04 nlxdodge

I have the same issue

sanjayatony avatar May 09 '24 00:05 sanjayatony