Skip to content

Count views of shareable resource pages in resource stats - #562

Merged
Alejandro Lopez (soyalejolopez) merged 1 commit into
microsoft:masterfrom
soyalejolopez:soyalejolopez-count-shareable-page-views
Oct 28, 2026
Merged

Alejandro Lopez (soyalejolopez) merged 1 commit into
microsoft:masterfrom
soyalejolopez:soyalejolopez-count-shareable-page-views

Conversation

@soyalejolopez

Copy link
Copy Markdown
Member

Category

  • New resource (script, agent, guide, analytics, skill)
  • Update to an existing resource
  • Bug fix
  • Docs, site, or tooling

What's in this pull request?

Follow-up to #559. The per-resource view stats only credited Clarity page URLs that carry a #<slug> hash (the catalog's detail route). The new shareable resource pages added in #559 live at /r/<slug>/ and send the same Clarity events, but their URLs have no hash, so views on those pages would not have counted toward card view counts or the Popular sort.

  • slugFromClarityUrl (moved into stats-state.js so it is testable) now resolves both #<slug> and /r/<slug>/ URLs.
  • Added unit tests for hash routes, shareable pages (with and without a trailing slash), unknown slugs, and the landing page.

This matters for the Agent 365 share: links to resource pages should add to the per-resource counts.

Related issues

Follow-up to #559.

Checklist

  • No private, customer-specific, or unlicensed content, and no secrets
  • npm run check --prefix tools/catalog-build passes (all unit tests, including the new stats-state cases)
  • No resource README changes, so no version or updated bumps are needed
  • Files over 5 MB were avoided

Clarity stats only credited page URLs with a #slug hash, so views of the new shareable pages (/r/<slug>/) would not have counted toward per-resource views. Recognize both URL shapes and add tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@soyalejolopez
Alejandro Lopez (soyalejolopez) merged commit 8a131da into microsoft:master Oct 28, 2026
5 checks passed
@soyalejolopez
Alejandro Lopez (soyalejolopez) deleted the soyalejolopez-count-shareable-page-views branch October 28, 2026 21:40
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.

2 participants