Have you tried adding is:inline to the script tag? That instructs astro to not do any processing on the script tag and to insert it as is into the dom https://docs.astro.build/en/reference/directives-reference/#isinline
#Unable to add tracking script :/
13 messages · Page 1 of 1 (latest)
Hi Lukas - unfortunately that doesn't work (adds another error complaining about the : as an unexpected token regardless of the script)
I'd made a mistake in the OP though: The script is also erroring locally: Uncaught TypeError: Cannot set properties of undefined (setting 'q')
is there a way to get TS to ignore the entire code block? maybe that would help?
Hmm, it looks like this script has some problems. It looks like it's automatically generated, but it seems like it has problems
This is not a typescript problem. The script is trying to access a property of an object (this) which is undefined
Have you double checked the instructions of the tracking software on how to add this script to your site?
The error you posted in your initial post is also just javascript. You can see in the second to last line that it does something like d = ... but d was never declared which is not valid javascript
yeah I just noticed the errors didn't seem to be ts errors anymore (probably means once I fixed this i'll have the ts errors to look forward to as well :D)
the instructions of the tracking software are literally just "paste this in the head" 😦
what's weird is the script can't really be wrong can it? surely someone else would've noticed!
Have you actually confirmed that tracking is not working?