Skip to content

feat: add analytics, visitor counter, support ribbon, and GitHub stars#21

Closed
anurag629 wants to merge 2 commits intocodercops:devfrom
anurag629:feat/website-analytics-support
Closed

feat: add analytics, visitor counter, support ribbon, and GitHub stars#21
anurag629 wants to merge 2 commits intocodercops:devfrom
anurag629:feat/website-analytics-support

Conversation

@anurag629
Copy link
Member

Summary

  • Google Analytics (G-GLYL9J6QYX) added to landing page and Starlight docs (same property as main codercops site)
  • Visitor counter using Upstash Redis — shows today/total counts in the landing page footer with session-based dedup (shared Redis instance with ogcops, keyed chatcops:)
  • Support ribbon — diagonal corner tape in top-right with Buy Me a Coffee and PayPal links (click to expand dropdown)
  • GitHub star count — fetched live from GitHub API, displayed in Hero "Star on GitHub" button and Header nav, cached in sessionStorage for 1 hour
  • Inline widget scroll fixpanel.show() no longer auto-focuses the textarea in inline mode, preventing unwanted scroll-to-widget on page load

Changes

File What
website/src/layouts/Landing.astro Google Analytics script, GitHub stars fetch script
website/astro.config.mjs GA tags in Starlight docs head config
website/src/lib/upstash.ts New — Upstash Redis client (incrementVisitors, getVisitors)
website/src/pages/api/visitors.ts New/api/visitors GET/POST endpoint
website/src/components/landing/Footer.astro Visitor counter display + client script
website/src/components/landing/SupportBanner.astro New — Diagonal ribbon with support links
website/src/pages/index.astro Import SupportBanner component
website/src/components/landing/Hero.astro Star count badge on GitHub button
website/src/components/landing/Header.astro GitHub icon + star count in nav
packages/widget/src/dom/panel.ts Skip auto-focus for inline panels

Test plan

  • Landing page loads without scrolling to the inline chat demo
  • Google Analytics events fire in Network tab (gtag)
  • Visitor counter shows today/total in footer (requires UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN env vars in Vercel)
  • Support ribbon visible in top-right corner, click expands dropdown with BMC and PayPal links
  • GitHub star count appears in Hero button and Header after API fetch
  • Starlight docs pages include GA script in head
  • Build succeeds with no errors

…ub stars

- Add Google Analytics (G-GLYL9J6QYX) to landing layout and Starlight docs
- Add Upstash Redis visitor counter (today/total) in footer with session dedup
- Add /api/visitors endpoint (GET/POST) with shared Upstash instance
- Add diagonal corner ribbon with Buy Me a Coffee and PayPal support links
- Add live GitHub star count to Hero button and Header nav
- Fix inline widget auto-scroll by skipping input focus in inline mode
@vercel
Copy link

vercel bot commented Mar 9, 2026

@anurag629 is attempting to deploy a commit to the CODERCOPS Team on Vercel.

A member of the Team first needs to authorize it.

@anurag629 anurag629 closed this Mar 9, 2026
@anurag629 anurag629 deleted the feat/website-analytics-support branch March 9, 2026 16:35
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