Skip to content

feat(analytics): enhance Plausible tracking with journey context#3169

Merged
MarkusNeusinger merged 3 commits intomainfrom
claude/plausible-tracking-audit-3fJdC
Jan 5, 2026
Merged

feat(analytics): enhance Plausible tracking with journey context#3169
MarkusNeusinger merged 3 commits intomainfrom
claude/plausible-tracking-audit-3fJdC

Conversation

@MarkusNeusinger
Copy link
Copy Markdown
Owner

Summary

  • User journey tracking: Added page property to copy_code and download_image events to distinguish where users perform actions (home, spec_overview, spec_detail)
  • New events: toggle_grid_size (view preference), filter_remove (filter removal tracking)
  • Bug fix: Added missing spec property to SpecTabs copy_code event
  • Faster tracking: Reduced debounce times for better event capture
    • pageview: 300ms → 150ms
    • search_no_results: 500ms → 200ms
  • Documentation: Comprehensive Plausible setup guide with custom properties list

Changes

File Change
useAnalytics.ts Reduced pageview debounce
FilterBar.tsx Added toggle_grid_size, reduced search debounce
ImageCard.tsx Added page: 'home' to copy_code
SpecPage.tsx Added page to copy_code and download_image
SpecTabs.tsx Added spec and page to copy_code
useFilterState.ts Added filter_remove event
docs/architecture/plausible.md Full documentation with Plausible dashboard setup

Plausible Dashboard Setup Required

After merge, register these custom properties in Plausible:

spec, library, method, page, category, value, query, destination, tab, size

Test plan

  • Verify copy_code events include page property in different contexts
  • Verify toggle_grid_size fires on view toggle
  • Verify filter_remove fires on filter removal
  • Check Plausible dashboard receives events correctly

🤖 Generated with Claude Code

claude and others added 2 commits January 5, 2026 19:59
…new events

- Add page property to copy_code and download_image for user journey tracking
  (home, spec_overview, spec_detail)
- Add toggle_grid_size event for view preference tracking
- Add filter_remove event for filter removal tracking
- Add spec property to SpecTabs copy_code (was missing)
- Reduce debounce times: pageview 300ms→150ms, search_no_results 500ms→200ms
- Move and update plausible.md documentation with Plausible dashboard setup guide

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 5, 2026 21:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances Plausible Analytics tracking by adding journey context to understand where users perform actions. It introduces the page property to distinguish user actions across different views (home, spec_overview, spec_detail), adds two new tracking events for UI interactions, fixes a missing property bug, optimizes event capture timing, and provides comprehensive documentation.

Key changes:

  • Added page property to copy_code and download_image events for journey tracking
  • Implemented toggle_grid_size and filter_remove events for better user behavior insights
  • Reduced debounce times (pageview: 300ms→150ms, search_no_results: 500ms→200ms) for faster tracking
  • Fixed missing spec property in SpecTabs copy_code event

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docs/architecture/plausible.md Comprehensive Plausible documentation with event catalog, custom properties reference, and dashboard setup guide
app/src/hooks/useAnalytics.ts Reduced pageview debounce from 300ms to 150ms for faster tracking
app/src/components/FilterBar.tsx Added toggle_grid_size event tracking and reduced search_no_results debounce to 200ms
app/src/components/ImageCard.tsx Added page: 'home' property to copy_code event
app/src/pages/SpecPage.tsx Added page property (spec_overview/spec_detail) to copy_code and download_image events
app/src/components/SpecTabs.tsx Fixed missing spec property and added page: 'spec_detail' to copy_code event
app/src/hooks/useFilterState.ts Added filter_remove event tracking for individual filter and group removals

Comment thread docs/architecture/plausible.md Outdated
| Event Name | Properties | Where | Description |
|------------|-----------|-------|-------------|
| `search` | `query`, `category` | FilterBar | User searches and selects value |
| `search_no_results` | `query` | FilterBar | Search query returns no results (debounced 500ms) |
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The debounce time in the documentation is outdated. According to the code changes in FilterBar.tsx, the debounce time has been reduced from 500ms to 200ms. The documentation should be updated to reflect this change.

Suggested change
| `search_no_results` | `query` | FilterBar | Search query returns no results (debounced 500ms) |
| `search_no_results` | `query` | FilterBar | Search query returns no results (debounced 200ms) |

Copilot uses AI. Check for mistakes.

### `library` Values
```
matplotlib | seaborn | plotly | bokeh | altair | plotnine | pygal | highcharts | letsplot
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The library name should be "lets-plot" (with a hyphen), not "letsplot". This is inconsistent with the rest of the codebase where it's consistently spelled as "lets-plot".

Suggested change
matplotlib | seaborn | plotly | bokeh | altair | plotnine | pygal | highcharts | letsplot
matplotlib | seaborn | plotly | bokeh | altair | plotnine | pygal | highcharts | lets-plot

Copilot uses AI. Check for mistakes.
@MarkusNeusinger MarkusNeusinger merged commit e2c26fa into main Jan 5, 2026
5 checks passed
@MarkusNeusinger MarkusNeusinger deleted the claude/plausible-tracking-audit-3fJdC branch January 5, 2026 21:30
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