Skip to content

feat: install Ahrefs Website Analytics on open.silver.dev - #34

Merged
lautaropaske merged 1 commit into
mainfrom
cursor/ahrefs-website-analytics-96c1
Sep 11, 2026
Merged

lautaropaske merged 1 commit into
mainfrom
cursor/ahrefs-website-analytics-96c1

Conversation

@Epotignano

@Epotignano Epotignano commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Companion to GRO-38. Main-site tracking lives in silver-dev-org/website; this repo serves open.silver.dev.

What

Load Ahrefs' native Website Analytics script on every page, gated on NEXT_PUBLIC_AHREFS_ANALYTICS_KEY.

The tracker is injected with next/script (strategy="afterInteractive", the Next.js equivalent of async) from the root layout, next to the existing Google Analytics tag. PostHog stays on instrumentation-client.ts. The script is omitted when the key is unset, so local/preview builds do not load it.

<script src="https://analytics.ahrefs.com/analytics.js" data-key="YOUR_KEY" async></script>

After merge

Set NEXT_PUBLIC_AHREFS_ANALYTICS_KEY in the production Vercel project (the public data-key from the Ahrefs Web Analytics project that includes open.silver.dev). Recheck installation in the Ahrefs dashboard.

Testing

  • bun tsc and bun run lint pass
  • Without the env key: no Ahrefs script; Google Analytics still present
  • With a local dummy key: script present on /, /fees-calculator, /resume-checker, and /salary-calculator with src="https://analytics.ahrefs.com/analytics.js", data-key, async, and afterInteractive. The browser requested analytics.ahrefs.com/analytics.js.
Open in Web Open in Cursor 

Companion to GRO-38: inject the native Ahrefs tracker via next/script
(afterInteractive) in the root layout, next to Google Analytics, and
only when NEXT_PUBLIC_AHREFS_ANALYTICS_KEY is present.

Co-authored-by: Emiliano Potignano <me@epotignano.com>
@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
open-silver Ready Ready Preview Sep 11, 2026 1:57pm UTC

Request Review

@lautaropaske lautaropaske left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm; already added key in open-silver @ vercel

@lautaropaske
lautaropaske merged commit 8a6e0cd into main Sep 11, 2026
3 checks passed
@lautaropaske
lautaropaske deleted the cursor/ahrefs-website-analytics-96c1 branch September 11, 2026 14:34

This branch was successfully deployed

1 active deployment
Preview — c4fc73b3 Deployed Sep 11, 2026 by vercel[bot]
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.

3 participants