Add instrumentation script for pageview analytics (#875)

* Add instrumentation script for pageview analytics

* Only include analytics tags in production builds

Wrap hydro-marketing analytics meta tag and script in an
import.meta.env.PROD conditional so they are excluded during
local development and only rendered in production builds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add production-only analytics tags to Starlight Head component

Add hydro-marketing analytics meta tag and script to the custom
Head.astro component override, gated behind import.meta.env.PROD
so they only render in production builds (GitHub Pages deploy).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
MV Karan
2026-03-06 02:30:52 +05:30
committed by GitHub
parent 8dcf0378ac
commit e3ee37a274

View File

@@ -9,3 +9,16 @@ const basePath = import.meta.env.BASE_URL;
document.body.dataset.basePath = basePath; document.body.dataset.basePath = basePath;
}); });
</script> </script>
{import.meta.env.PROD && (
<>
<meta
name="ha-url"
content="https://collector.githubapp.com/awesome-copilot-web/collect"
/>
<script
async
defer
src="https://analytics.githubassets.com/hydro-marketing.min.js"
></script>
</>
)}