Skip to content

Conversation

@danieltprice
Copy link
Collaborator

@danieltprice danieltprice commented Jan 27, 2026

Summary

Adds comprehensive analytics tracking to documentation components to measure user engagement and navigation patterns.

Changes

Sidebar Actions

  • ✅ Added tracking to "Copy markdown" and "Copy neon init command" actions
  • ✅ Added tag_name: "DocsSidebar" to all 7 sidebar actions (Edit on GitHub, Open in ChatGPT, etc.)

Link Tracking

  • Navigation cards (tag_name: "DocsNavCard"): Track clicks on hub page cards (e.g., "Learn the basics", "Connect")
  • Inline doc links (tag_name: "DocsInlineLink"): Track cross-reference clicks within content
  • Tech cards (tag_name: "TechCard"): Track framework/language selection clicks
  • Pagination (tag_name: "DocsPagination"): Track Previous/Next navigation at page bottom
  • ✅ Enhanced Link component to include destination URL in all link events

Tab Tracking

  • Code tabs (tag_name: "CodeTab"): Track language/framework preference when switching code examples
  • Content tabs (tag_name: "ContentTab"): Track platform/OS selection (macOS, Windows, Linux)

Navigation Tracking

  • Table of Contents (tag_name: "TableOfContents"): Track in-page section jumps with heading details
  • Community banner (tag_name: "CommunityBanner"): Track Discord/Discourse engagement from docs

CTA Tracking

  • Docs CTA buttons (tag_name: "DocsCTA"): Track signup clicks on extension/guide pages

Analytics Benefits

This tracking enables analysis of:

  • Language preferences: Which code examples developers use most
  • Platform distribution: macOS vs Windows vs Linux user breakdown
  • Navigation patterns: How users move through documentation
  • Content effectiveness: Which pages/sections drive engagement
  • Tutorial completion: Track sequential reading via pagination clicks
  • Feature discovery: Which frameworks/tools attract most interest

All events include page_path for context and use consistent tag_name values for filtering in Superset.

@vercel
Copy link

vercel bot commented Jan 27, 2026

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

Project Deployment Actions Updated (UTC)
neon-next Ready Ready Preview, Comment Jan 31, 2026 2:11pm

Request Review

Add analytics tracking to docs navigation and interaction components:

**Link Tracking:**
- Navigation cards (DetailIconCards): Track hub page navigation clicks
- Inline doc links (DocsLink): Track cross-reference clicks
- Tech cards (TechCards): Track framework/tool selection
- Prev/Next pagination: Track sequential doc reading
- Add destination URLs to all link events

**Tab Tracking:**
- Code tabs: Track language/framework preferences
- Content tabs: Track platform/OS selection

**Navigation Tracking:**
- Table of Contents: Track in-page section jumps
- Community banner: Track Discord/forum engagement

All events include page_path for context and use consistent tag_name
values for easy filtering in analytics.
@danieltprice danieltprice changed the title docs: sidebar tracking docs: docs tracking Jan 27, 2026
@vburlak
Copy link
Contributor

vburlak commented Jan 30, 2026

Thanks for the update @danieltprice! Looks awesome.
One thing to note: Mixed casing patterns in event names:

sendGtagEvent('Action Clicked', { ... });  // Title Case
sendGtagEvent('Tab clicked', { ... });     // Sentence case
sendGtagEvent('Link clicked', { ... });    // Sentence case
sendGtagEvent('TOC clicked', { ... });     // Acronym + sentence

I hope it would be great to standardize on one casing convention for consistency in analytics dashboards (e.g., all lowercase link_clicked or consistent Title Case Link Clicked).

Thanks!

Addresses review feedback to use consistent Title Case for all
analytics event names (e.g., 'Tab Clicked' instead of 'Tab clicked').
@danieltprice danieltprice merged commit 7fc116f into main Jan 31, 2026
2 checks passed
@danieltprice danieltprice deleted the docs-sidebar-tracking branch January 31, 2026 14:14
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