Skip to content

feat(web): count page views - #24

Merged
synacktraa merged 1 commit into
devfrom
feat/web-analytics
Sep 10, 2026
Merged

synacktraa merged 1 commit into
devfrom
feat/web-analytics

Conversation

@synacktraa

Copy link
Copy Markdown
Owner

Enabling Web Analytics in the Vercel dashboard collects nothing from a Next.js app on its own. The beacon is a component, so without it the feature is on in one place and absent in the other, and the project reports 0 views indefinitely.

What is here

@vercel/analytics 2.0.1 a dependency, 21 packages, 0 vulnerabilities
app/layout.tsx <Analytics /> from @vercel/analytics/next, mounted in body

Findings

The chain cannot answer this question. The seller account counts demo runs exactly, at 2 payments each, and it stood at 63 before the launch post and 63 after 93 views. A visitor who opened the page and did not press the button leaves no trace on chain, so "the page does not convert" and "almost nobody arrived" look identical from there and want opposite fixes.

The dashboard toggle is half the feature. Other frameworks inject the script at the platform layer; a Next.js app has to mount the component, and @vercel/analytics/next is the subpath that carries the App Router version.

Nothing changes about the payment path. The beacon is cookieless and records page views. It runs on the page rather than between the button and the chain, so the claim in web/README.md that no route sits behind the button still holds.

Verification

tsc --noEmit clean and 37 tests pass, which confirms the subpath resolves at the type level. The script itself mounts client-side after hydration and is debug-only in development, so it does not appear in served HTML locally and is checked on the deployment instead.

Collection starts at deploy. The launch traffic is already gone and does not backfill.

Scope

Web only. The contract, the SDK and the seller are untouched. Unaudited, and built for testnet.

Enabling Web Analytics in the Vercel dashboard collects nothing from a Next.js
app on its own - the beacon is a component, and without it the toggle is off in
one place and absent in the other. `<Analytics />` mounts in the root layout.

The question it answers is the one the chain cannot. The seller account counts
demo runs exactly, two payments each, but a visitor who opened the page and did
not press the button leaves no trace on chain at all. Those two cases want
different fixes and until now looked identical: 0 runs against 93 views could
mean the page does not convert or that almost nobody arrived.

Cookieless, and page views only. The claim that nothing of ours sits in the
payment path is unaffected - this runs on the page, not between the button and
the chain.

Collection starts from deploy. The launch traffic is already gone and does not
backfill.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@synacktraa
synacktraa merged commit d760c7b into dev Sep 10, 2026
4 checks passed
@synacktraa
synacktraa deleted the feat/web-analytics branch September 10, 2026 08:39
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