Skip to content

Commit e3ee37a

Browse files
mvkaranCopilot
andauthored
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>
1 parent 8dcf037 commit e3ee37a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

website/src/components/Head.astro

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,16 @@ const basePath = import.meta.env.BASE_URL;
99
document.body.dataset.basePath = basePath;
1010
});
1111
</script>
12+
{import.meta.env.PROD && (
13+
<>
14+
<meta
15+
name="ha-url"
16+
content="https://collector.githubapp.com/awesome-copilot-web/collect"
17+
/>
18+
<script
19+
async
20+
defer
21+
src="https://analytics.githubassets.com/hydro-marketing.min.js"
22+
></script>
23+
</>
24+
)}

0 commit comments

Comments
 (0)