Skip to content

Add Google Analytics script to config - #92

Merged
M9nx merged 1 commit into
mainfrom
M9nx-patch-1
Oct 3, 2026
Merged

M9nx merged 1 commit into
mainfrom
M9nx-patch-1

Conversation

@M9nx

@M9nx M9nx commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Summary

Add Google Analytics script to config

Changes

I added the Google Analytics tag (G-Q0ELMEF4DB) to the CodexA docs site, and a local build put it on every page. It isn't live yet: you need to commit and push the change, and the docs deploy workflow (deploy-docs.yml) will publish it.

The site is built with VitePress, so I put the tag in the site-wide head setting in docs/.vitepress/config.mts rather than editing any HTML by hand:

['script', { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-Q0ELMEF4DB' }],
['script', {}, `window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-Q0ELMEF4DB');`],

After deploying, you can confirm it's working by opening the live site while watching GA's Realtime report.

VitePress changes pages without a full reload. GA4 still counts those page views as long as Page changes based on browser history events is on. It's on by default, under Admin → Data streams → your stream → Enhanced measurement.

@M9nx M9nx self-assigned this Oct 3, 2026
@M9nx M9nx added the documentation Improvements or additions to documentation label Oct 3, 2026
@M9nx
M9nx merged commit efccb5a into main Oct 3, 2026
16 checks passed
@M9nx
M9nx deleted the M9nx-patch-1 branch October 7, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant