Add CrawlProof stats tracker - #1
Merged
ralyodio merged 1 commit intoAug 30, 2026
Merged
Conversation
ralyodio
deleted the
crawlproof/install-stats-tracker-2026-08-30T15-31-00
branch
August 30, 2026 15:33
ralyodio
added a commit
that referenced
this pull request
Aug 30, 2026
PR #1 pasted a third-party <script> straight into layout.ts. On this board that tag never runs: the policy is script-src 'self' with no 'unsafe-inline' anywhere, so it is blocked — silently, which is the worst way for analytics to fail, because the page looks perfect and simply records nothing. Widening the policy has to be the plugin's doing rather than the layout's, so that switching the plugin off takes the permission with it. The grant is also conditional on being used: script-src and connect-src are only widened when an analytics ID is actually set, so a board that does not want analytics ships no third-party script and no third-party permission. The site ID is a plugin setting now, alongside the ad slot. 105 tests, 0 type errors.
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.
This PR adds the CrawlProof stats tracker to your site.
What it does: counts pageviews by source — AI engine referrals (ChatGPT, Perplexity, Claude, Gemini…) and AI crawler hits (GPTBot, ClaudeBot, PerplexityBot…). No cookies. No PII. Rolls up to a daily counter on the CrawlProof Stats tab for your project.
What changed: one line added to
packages/ui/src/components/layout.ts, just before</body>:Docs: https://crawlproof.com/docs/stats-tracker
Disable: flip the tracker off on your CrawlProof project Stats tab and the script becomes a no-op (or remove this line).