-
Notifications
You must be signed in to change notification settings - Fork 126
Add explore analytics #13658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add explore analytics #13658
Conversation
|
raymondjacobson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this data is going to be high quality enough
| }) => { | ||
| const { user_id, name, handle, follower_count } = user | ||
| const { trackEvent } = useAnalytics() | ||
| const isMobile = typeof window !== 'undefined' && window.innerWidth < 768 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we have helpers for this?
packages/web/src/pages/search-explore-page/components/desktop/UserArtCard.tsx
Outdated
Show resolved
Hide resolved
packages/web/src/pages/search-explore-page/components/desktop/QuickSearchGrid.tsx
Outdated
Show resolved
Hide resolved
16b8b26 to
eafc257
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| section: sectionName, | ||
| source: isMobile ? 'mobile' : 'web', | ||
| id, | ||
| kind: 'playlist', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collection click analytics hardcodes kind as playlist
Low Severity
CollectionArtCard hardcodes kind: 'playlist' in the EXPLORE_SECTION_CLICK analytics event, but a collection can also be an album. Since the ExploreSectionClick type explicitly supports both 'playlist' and 'album' as valid kinds, the analytics data will misclassify album clicks as playlist clicks. The collection data from useCollection is already available and could be used to determine the correct kind.


We should analyze usage here and pair back explore page to what's working. helps simplify and improve performance
Note
Medium Risk
Touches analytics instrumentation across many Explore/Search-Explore components; risk is mainly accidental over/under-counting due to in-view detection and dependency changes, but no core business logic is modified.
Overview
Adds new Explore analytics events (
Explore: Section ViewandExplore: Section Click) to the shared analytics model, including a typedExploreSectionNameunion and event payload fields (section,source, optionalid/kind/link).On mobile Explore, replaces
useDeferredElementusage with a newuseExploreSectionTrackinghook that fires a section-impression event when each section enters view.On web Search/Explore, introduces a similar
useExploreSectionTrackinghook and swaps existing deferred rendering in multiple sections to use it; additionally wires click tracking intoTrackArtCard,CollectionArtCard, andUserArtCard(when provided asectionName) before navigating.Written by Cursor Bugbot for commit 84b5817. This will update automatically on new commits. Configure here.