Skip to content

Add engagement events - #3

Merged
mwburke merged 1 commit into
masterfrom
claude/engagement-events
Aug 18, 2026
Merged

Add engagement events#3
mwburke merged 1 commit into
masterfrom
claude/engagement-events

Conversation

@mwburke

@mwburke mwburke commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Adds the three engagement events, matching the eight hand-written articles.

Why

GA4 enhanced measurement gives a pageview and one scroll event at 90%. For an article made of fifteen interactive 3D figures, that answers neither useful question: was a figure touched, and where do people stop.

Events

event when params
read_depth 25 / 50 / 75 / 100 % percent
widget_interact first touch of each figure id
crosslink_click inline links to sibling articles link_url

Wired through SiteHead, so the tool page gets them too — the same reason the analytics and social tags already live there rather than in the layout.

On the copied file

engagement.js is a copy of tools/engagement/engagement.js in the orbitope.github.io repo, imported with ?raw so it stays one file to edit rather than a snippet pasted into an .astro template. The two sites build in completely different ways and there is no shared package between them, so a copy is the honest option; the duplication is noted in both places.

Verification

Built docs/ served locally and driven with a real browser, reading window.dataLayer with Google's endpoints blocked: nothing fires on load, and all four depth marks fire on a full read.

🤖 Generated with Claude Code

GA4 enhanced measurement gives a pageview and one scroll event at 90%, which
for an article built out of interactive figures answers neither useful
question: was a figure touched, and where do people stop.

Three events — read_depth at 25/50/75/100, widget_interact once per figure, and
crosslink_click — inlined through SiteHead so both this page and the tool page
get them, the same way they already share the analytics and social tags.

The source is a copy of tools/engagement/engagement.js in the orbitope.github.io
repo, imported with ?raw so it stays one file to edit rather than a snippet
pasted into an .astro template. The two sites build in completely different
ways, so a copy is the honest option; there is no shared package here.

Verified against the built docs/ over a local server: nothing fires on load and
all four depth marks fire on a full read.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mwburke
mwburke merged commit 490e068 into master Aug 18, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant