Track clicked links, not just typed commands - #48
Merged
Conversation
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.
Deploying with
|
| 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 |
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.
Clicking a directory link replays a
cd+ls -athe 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
terminalcategory:commandclickoutlinkKept as separate actions rather than folding clicks into
commandso the stats show which way people actually explore. Matomo'senableLinkTrackingcan't see these — they're terminal cells painted by xterm's link provider, not DOM anchors.Testing
wrangler devlocally with the hostname gate temporarily pointed at localhost: clicking theprojectslink firede_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.