Skip to content

docs: add Scarf web traffic pixels (landing page, docs, README) - #651

Open
darlisagc wants to merge 2 commits into
masterfrom
docs/scarf-web-traffic-pixels
Open

docs: add Scarf web traffic pixels (landing page, docs, README)#651
darlisagc wants to merge 2 commits into
masterfrom
docs/scarf-web-traffic-pixels

Conversation

@darlisagc

@darlisagc darlisagc commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Adds three Scarf web traffic pixels, following the markup recommended in the Scarf web traffic docs.

Changes

Property File Pixel ID
Landing page — cardano-client.dev/ docs/app/page.jsx 01b00b88-…
Docs — all pages docs/app/docs/layout.jsx 85d58a23-…
GitHub repo page README.md 228307f6-…

Three files, +24/−0. No dependencies added, no config changes.

Each property reports to its own counter, so landing / docs / GitHub traffic stay separable. The docs pixel sits in the shared Nextra footer, so all 65 docs pages feed a single "docs" number rather than any one page being tracked on its own.

Implementation notes

Per Scarf's guidance, each pixel is a 1×1 image with referrerpolicy="no-referrer-when-downgrade" and alt="", placed in footer / end-of-page markup rather than in <head> or visible nav, so it cannot affect layout. On the site the pixels also carry a hidden absolute-position style.

The README pixel differs in two ways, both per Scarf's GitHub guidance:

  • carries an explicit &page=README.md, because GitHub proxies images and the referrer header is unreliable there
  • omits the style attribute, which GitHub's markdown sanitizer strips

Attributes are camelCased in the JSX sources and lowercase in the README, since that file is plain HTML.

Scarf pixels are cookie-free, so no consent banner is required.

Verification

  • npm ci && npm run build in docs/ succeeds — 66 pages indexed.
  • Docs pixel present in 65/65 built docs pages, exactly one <img> per page.
  • Pixels do not leak across properties: the landing page carries no docs pixel, and docs pages carry no landing pixel. The docs pixel is absent from every JS chunk the landing page loads, so it cannot fire there.
  • gettingstarted/concepts.mdx is byte-identical to master.

Notes for reviewers

README pixel — the most visible part of this change: it appears in the repo's front page source and in every fork. Standard practice for OSS projects using Scarf, but flagging it so maintainers can weigh in.

Landing page pixel is inside a 'use client' component, so it compiles into a JS chunk and fires after hydration rather than appearing in out/index.html. It works in normal browsers; crawlers and JS-disabled visitors won't register — arguably desirable, since the count then skews toward real people. The docs and README pixels are in server-rendered markup and appear in the raw HTML.

Deployment — merging this will not update the live site on its own. docs-deploy.yml publishes docs/out to gh-pages on a rel-docs* tag, so a tag needs to be cut for the site pixels to go live. The README pixel takes effect as soon as this merges.

🤖 Generated with Claude Code

darlisagc and others added 2 commits August 26, 2026 15:23
Adds cookie-free Scarf tracking pixels using the markup recommended in
https://docs.scarf.sh/web-traffic/ - referrer policy set to
no-referrer-when-downgrade, 1x1 hidden image placed at the end of the
page rather than in <head> or visible nav markup.

- Landing page (docs/app/page.jsx): pxid 01b00b88
- Getting Started > Concepts (concepts.mdx): pxid 85d58a23

Attributes are camelCased since these are JSX/MDX sources; they render
as standard lowercase HTML attributes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Reworks the pixels so each property reports to its own counter, rather
than tracking one specific docs page:

- Moves the docs pixel out of gettingstarted/concepts.mdx and into the
  shared Nextra footer (docs/app/docs/layout.jsx), so all 65 docs pages
  report to a single counter instead of one page being tracked alone.
- Adds a pixel to README.md (pxid 228307f6) to count views of the GitHub
  repo page. Carries an explicit &page=README.md, as Scarf recommends for
  GitHub-rendered markdown where image proxying makes the referrer header
  unreliable, and omits the style attribute since GitHub's sanitizer
  strips it.

Landing page pixel is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@darlisagc darlisagc changed the title docs: add Scarf web traffic pixels to landing page and Concepts docs: add Scarf web traffic pixels (landing page, docs, README) Aug 28, 2026
@darlisagc darlisagc self-assigned this Aug 28, 2026
@darlisagc
darlisagc requested a review from satran004 August 28, 2026 14:24
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