Skip to content

Conversation

@mikemuzza
Copy link
Contributor

@mikemuzza mikemuzza commented Oct 30, 2025

Summary

  • Added Sprig tracking event viewed_featureflags_docs that triggers when users visit /docs/featureflags
  • Follows the same pattern as existing experiments page tracking (viewed_experimentation_docs)
  • Uses shared debouncing logic to prevent duplicate events within 1 second
  • Includes proper error handling and null checks

Implementation Details

  • Event name: viewed_featureflags_docs (follows naming pattern of viewed_experimentation_docs)
  • Triggers on: Initial page load and route changes to /docs/featureflags
  • Location: hooks/useSprig.ts:95-137

Testing

  • ✅ Verified event fires correctly when visiting feature flags page
  • ✅ TypeScript compilation passes with no errors
  • ✅ No React hooks violations
  • ✅ No hydration errors
  • ✅ Existing experiments tracking still works correctly
  • ✅ Debouncing works across both trackers

Test Plan

  • Visit /docs/featureflags and verify viewed_featureflags_docs event fires in Sprig
  • Navigate between experiments and feature flags pages to verify both events fire correctly
  • Verify no duplicate events are sent within 1 second

🤖 Generated with Claude Code

Added tracking event `viewed_featureflags_docs` that fires when users visit the `/docs/featureflags` page. This follows the same pattern as the existing experiments page tracking (`viewed_experimentation_docs`).

- Uses shared debouncing logic to prevent duplicate events
- Tracks both initial page loads and route changes
- Includes proper error handling and null checks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@mikemuzza mikemuzza requested a review from a team as a code owner October 30, 2025 23:31
@mikemuzza mikemuzza requested review from myronkaifung and removed request for a team October 30, 2025 23:31
@vercel
Copy link

vercel bot commented Oct 30, 2025

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

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Oct 30, 2025 11:34pm

@mikemuzza
Copy link
Contributor Author

Should be a quick one here, hope you can take a look Ryan. Thank you!

};

// Track if already on feature flags page
if (router.asPath.includes('/docs/featureflags')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like this could be merged with track experiment page view above

Copy link
Contributor

@ryancurtis1 ryancurtis1 left a comment

Choose a reason for hiding this comment

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

I agree with Hans's comment to merge the page view tracking. Otherwise looks good to me

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.

4 participants