Umami Analytic in Astro
Umami Analytic is the choice for anyone that is privacy conscious but would like to have some information about their web traffic.
Thankfully, integration with Astro is simple as can be.
In the default layout.astro
(or wherever you define your base), provide a reference to the umami script.
<html lang="en">
<head>
<script is:inline async src="https://analytics.umami.is/script.js" data-website-id="e3514793-f854-4784-95e9-ce141fc7f79a" data-do-not-track="true"></script>
</head>
</html>
That is all. Thank you for coming to my TED Talk. For the curious, here is some noteworthy stuff:
is:inline
Is rather important and will inform astro to not bundle the external script.async
Because of course we do not want this to impact performance.data-do-not-track
Since we care about privacy, we should respect this attribute if the user has set it.