Skip to content

Track clicked links, not just typed commands - #48

Merged
dubsector merged 1 commit into
mainfrom
track-link-clicks
Aug 2, 2026
Merged

Track clicked links, not just typed commands#48
dubsector merged 1 commit into
mainfrom
track-link-clicks

Conversation

@dubsector

Copy link
Copy Markdown
Owner

Clicking a directory link replays a cd + ls -a the visitor never typed, and the only tracked path was the Enter key handler, so those visits looked like they did nothing after landing.

Both link kinds now report, under the existing terminal category:

Action Name Fires on
command the command line Enter on a hand-typed command
click directory name clicking a directory link
outlink URL clicking an external-URL link

Kept as separate actions rather than folding clicks into command so the stats show which way people actually explore. Matomo's enableLinkTracking can't see these — they're terminal cells painted by xterm's link provider, not DOM anchors.

Testing

wrangler dev locally with the hostname gate temporarily pointed at localhost: clicking the projects link fired e_c=terminal e_a=click e_n=projects, accepted 204 by Matomo, alongside the pageview. The external-URL path is the same two-line code path but I could not land a synthetic click on those cells to exercise it end to end.

Clicking a directory link runs a command the visitor never typed, so it
was invisible in the stats - the only tracked path was the Enter key.
Directory links now send a click event and external ones an outlink
event, both under the existing terminal category, so the two ways of
exploring stay distinguishable.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
terminal ccc4d73 Commit Preview URL

Branch Preview URL
Aug 02 2026, 03:52 AM

@dubsector
dubsector merged commit 37a5960 into main Aug 2, 2026
5 checks passed
@dubsector
dubsector deleted the track-link-clicks branch August 2, 2026 03:53
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