docs: add Scarf web traffic pixels (landing page, docs, README) - #651
Open
darlisagc wants to merge 2 commits into
Open
docs: add Scarf web traffic pixels (landing page, docs, README)#651darlisagc wants to merge 2 commits into
darlisagc wants to merge 2 commits into
Conversation
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>
|
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.



Adds three Scarf web traffic pixels, following the markup recommended in the Scarf web traffic docs.
Changes
cardano-client.dev/docs/app/page.jsx01b00b88-…docs/app/docs/layout.jsx85d58a23-…README.md228307f6-…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"andalt="", 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:
&page=README.md, because GitHub proxies images and the referrer header is unreliable therestyleattribute, which GitHub's markdown sanitizer stripsAttributes 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 buildindocs/succeeds — 66 pages indexed.<img>per page.gettingstarted/concepts.mdxis 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 inout/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.ymlpublishesdocs/outto gh-pages on arel-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