Repository navigation
Sites: GA4 and PostHog on lazarus-xbt.xyz and pool.lazarus-xbt.xyz - #82
Merged
Merged
Conversation
Both hosts load one self-hosted file (hub /assets/analytics.js, pool /static/analytics.js, identical) that starts GA4 (property "Lazarus Pool websites", G-CFKT50ZPQE) and PostHog (project "Lazarus sites", 625142). One property and one project cover both hosts: their cookies sit on .lazarus-xbt.xyz, so a hub-to-pool visit is one visitor and one session. The file does nothing off lazarus-xbt.xyz and pool.lazarus-xbt.xyz (pages.dev previews, the node, local servers). The hub's CSP gains the hosts Google and PostHog document (googletagmanager, google-analytics, analytics.google, *.posthog.com) and worker-src blob: data: for replay. The pool sends no CSP. Sitemaps: the pool's lastmod hash already ignores <script>, so its dates hold. The hub dates pages by git commit, so sitemap-lastmod.mjs now skips commits listed in scripts/lastmod-ignore-revs; this commit goes there in the next one. Tests check every sitemap page carries the tag and that the two copies match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7ab669d added a script tag and CSP hosts to every hub page and changed no words, so it is listed in lastmod-ignore-revs and each page keeps its date. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Google Analytics 4 and PostHog to the hub and the pool site.
Accounts (Brett owns both)
G-CFKT50ZPQE. Enhanced measurement on, event retention 14 months,lazarus-xbt.xyzlisted under the tag's domains, and Search Console (sc-domain:lazarus-xbt.xyz) linked to the stream.One property and one project for both sites: GA4 and PostHog set their cookies on
.lazarus-xbt.xyz, so a visit that goes from the hub to the pool counts as one visitor and one session. Reports split by hostname.Code
cloudflare/map-site/public/assets/analytics.jsandpool/static/analytics.js, two identical copies. The file does nothing on any host other thanlazarus-xbt.xyzandpool.lazarus-xbt.xyz, so the pages.dev previews, the node and local servers don't report.<script src=".../analytics.js?v=1" defer>tag on every hub page (8 static pages,/map/, and the Worker-rendered pages throughshell.jsHEAD) and every pool page (theindex.htmltemplate,miner.html,404.html). No inline script, so the hub's no-inline rule and the naughtylist test still hold._headersandPAGE_CSP) adds the hosts Google and PostHog document, plusworker-src 'self' blob: data:for replay. The pool site sends no CSP.Sitemaps
lastmod.pyhashes page text with<script>stripped, so no date moves (checked:PASS: 30 sitemap dates match).sitemap-lastmod.mjsnow skips commits listed inscripts/lastmod-ignore-revs(the same idea as.git-blame-ignore-revs), and 7ab669d is listed there. Merge with a merge commit, not squash or rebase, or that hash won't be on main and--checkwill fail.Tests
Run locally: pool build +
indexing.py+lastmod.py+language.mjs, hubtest-indexing+sitemap-lastmod --check+test-naughtylist, and MCP tests all pass. New assertions: every sitemap page on both sites carries the tag, and the twoanalytics.jscopies are byte-identical.🤖 Generated with Claude Code