Skip to content

Add docs CTAs, sticky install banner, and analytics tracking#1025

Closed
AvdLee wants to merge 1 commit into
masterfrom
codex/implement-docscta-component-and-sticky-banner
Closed

Add docs CTAs, sticky install banner, and analytics tracking#1025
AvdLee wants to merge 1 commit into
masterfrom
codex/implement-docscta-component-and-sticky-banner

Conversation

@AvdLee
Copy link
Copy Markdown
Owner

@AvdLee AvdLee commented May 24, 2026

Motivation

  • Increase install conversions from docs traffic with low-risk, additive UX patterns while preserving the existing design system and performance.
  • Provide lightweight instrumentation to measure CTA impressions, clicks, and banner interactions using the existing Plausible integration when available.

Description

  • Added a reusable DocsCTA Astro component supporting title, description, primary, optional secondary, a compact variant, responsive layout, accessible focus states, and data attributes for analytics hooks.
  • Added a dismissible, mobile-friendly DocsInstallBanner component that persists dismissal in localStorage and is dark-mode compatible.
  • Integrated automatic placement by rendering hidden CTA templates and the banner from src/components/starlight/Footer.astro and injecting them into docs pages via a small client script src/scripts/docs-engagement.ts (inserts a compact CTA after the first major content section and a full CTA at the bottom) without modifying MD/MDX sources.
  • Instrumented events to use the existing Plausible helper when available, tracking Docs CTA Impression (with placement), CTA clicks (per-CTA event names), Docs Banner Shown, Docs Banner Dismissed, and Docs Banner Click.
  • Added scoped styling in src/styles/starlight-custom.css to match the Starlight design tokens and provide accessible focus outlines and responsive behavior.
  • Files changed / components added / integration points: modified src/components/starlight/Footer.astro and src/styles/starlight-custom.css, added src/components/starlight/DocsCTA.astro, src/components/starlight/DocsInstallBanner.astro, and src/scripts/docs-engagement.ts, and wired the client module into the docs footer to run only on docs content pages.

Testing

  • Ran cd docs && npm run lint and lint passed successfully.
  • Ran cd docs && npm run format:check (Prettier) and formatting passed successfully after adjustments.
  • Ran cd docs && npm run typecheck and type checks passed (client script compiled as a module and exported an empty export to satisfy module scope).
  • Ran cd docs && npm run knip and it completed successfully.
  • Ran cd docs && npm run build which completed client and static build steps locally but the full build failed in this environment due to an external network fetch error in src/pages/blog/[slug].astro (ENETUNREACH), unrelated to the CTA/banner changes; the docs-specific changes themselves did not trigger errors.

TODO / Recommendations

  • Optionally align CTA event naming with existing plausible-event-name=... taxonomy for easier dashboard grouping.
  • Consider excluding the docs homepage from the automatic insertions if overlapping homepage CTAs are undesirable (see src/components/starlight/PageTitle.astro).
  • Monitor metrics after rollout and A/B test messaging or placement if desired.

Codex Task

@AvdLee
Copy link
Copy Markdown
Owner Author

AvdLee commented May 26, 2026

Closing this, we will do it differently

@AvdLee AvdLee closed this May 26, 2026
@AvdLee AvdLee deleted the codex/implement-docscta-component-and-sticky-banner branch May 26, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant