generated from nhcarrigan/template
feat: track domain, path, title
This commit is contained in:
parent
1022316d35
commit
ea060a775c
@ -41,7 +41,8 @@ export default defineConfig({
|
||||
id: "analytics",
|
||||
src: "https://analytics.nhcarrigan.com/js/script.file-downloads.outbound-links.js",
|
||||
defer: true,
|
||||
"data-domain": "nhcarrigan.com"
|
||||
"data-domain": "nhcarrigan.com",
|
||||
"event-domain": "docs.nhcarrigan.com",
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -4,6 +4,10 @@ import { Icon } from "@astrojs/starlight/components";
|
||||
|
||||
{/* This is intentionally inlined to avoid FOUC. */}
|
||||
<script is:inline>
|
||||
const analytics = document.getElementById('analytics');
|
||||
const title = document.querySelector('title');
|
||||
analytics.setAttribute('event-page', title.innerText ?? "NHCarrigan Docs");
|
||||
analytics.setAttribute('event-path', window.location.pathname);
|
||||
window.StarlightThemeProvider = (() => {
|
||||
const storedTheme =
|
||||
typeof localStorage !== 'undefined' && localStorage.getItem('starlight-theme');
|
||||
|
Loading…
x
Reference in New Issue
Block a user