Skip to content
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

[Statsig] Instrument feed display #3455

Merged
merged 2 commits into from
Apr 9, 2024
Merged

[Statsig] Instrument feed display #3455

merged 2 commits into from
Apr 9, 2024

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Apr 9, 2024

Adds an event that fires when a feed is displayed, along with the index and the reason. It was a bit tricky to figure out the right place to thread these through. This is the minimally invasive way I've found.

Test Plan

Add console.log to logEvent in statsig.tsx.

  • Reload
  • Use tabbar
  • Use swipe
  • On desktop, use right nav
  • Switch between tabs

You should see events firing according to the schema.

@gaearon gaearon requested a review from pfrazee April 9, 2024 20:56
Copy link

github-actions bot commented Apr 9, 2024

Old size New size Diff
6.36 MB 6.36 MB 336 B (0.01%)

Copy link
Member

@estrattonbailey estrattonbailey left a comment

Choose a reason for hiding this comment

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

Works great!

Comment on lines +100 to +109
useFocusEffect(
useNonReactiveCallback(() => {
logEvent('home:feedDisplayed', {
index: selectedIndex,
feedType: selectedFeed.split('|')[0],
feedUrl: selectedFeed,
reason: 'focus',
})
}),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

cool. i remember you making this suggestion for these cases, glad to see it in action!

Copy link
Collaborator

@pfrazee pfrazee left a comment

Choose a reason for hiding this comment

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

Tested on Web. Looks good!

@pfrazee pfrazee merged commit c300d4c into main Apr 9, 2024
6 checks passed
@pfrazee pfrazee deleted the statsig-displayed-feed branch April 9, 2024 22:09
estrattonbailey added a commit that referenced this pull request Apr 12, 2024
* origin/main: (455 commits)
  Use getSuggestions endpoint behind the gate (#3499)
  Added `new_profile_scroll_component` to `Gate` type (#3487)
  Fix useGate lint rule (#3486)
  Make bio area scrollable on iOS (#2931)
  Improve Android haptic, offer toggle for haptics in the app (#3482)
  Search - only enable queries once tab is active (#3471)
  [Statsig] Mark Testflight as staging tier (#3470)
  [Statsig] Typecheck gates (#3467)
  Bump to 1.77 (#3468)
  Search - extra tabs (#3408)
  notify slack on production builds (#3461)
  notify slack on production builds (#3460)
  1.76 release preparations (#3459)
  Update zh-CN translation (#3433)
  Italian Localization (#3388)
  [Statsig] Send prev route name (#3456)
  [Statsig] Instrument feed display (#3455)
  Small logic cleanups (#3449)
  Use ALF for the embed consent modal (#3336)
  Onboarding tweaks (#3447)
  ...
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