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

chore(metrics): Only track 'Loaded a Page' event to Amplitude when userId is known #9193

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tianrunhe
Copy link
Contributor

@tianrunhe tianrunhe commented Nov 14, 2023

Description

Amplitude bills us on MTU (Monthly Tracking User). Last month our MTU is a little bit above the limit of 100K however our MAU is only at 60K. Upon investigation, I found that there were enough anonymous users triggering the page view events. For example, this user just visited parabol.co, this user run a demo, and this user reset the password. They were not registered or logged in. Amplitude count them as distinct users, causing our MTU spikes.
Eventually we would like to have the anonymous traffic in Amplitude too (majority being from www.parabol.co) so we can do full channel analysis but today is not the date yet (plus we can achieve similar functionality by GA).
This simple change just assure that only when the userId is know, that we sent Loaded a Page event to Amplitude. This way the MTU should be in line with our MAU so we have more buffer below the 100K threshold.

Testing scenarios

  • Open up developer tool on your browser
  • Go to a page without logged in: localhost:3000/create-account or localhost:3000/forgot-password and see no Amplitude debug info output
  • Logged in, visit any pages and observe the Amplitude debug output, indicating the Loaded a Page event is sent

Final checklist

  • I checked the code review guidelines
  • I have added Metrics Representative as reviewer(s) if my PR invovles metrics/data/analytics related changes
  • I have performed a self-review of my code, the same way I'd do it for any other team member
  • I have tested all cases I listed in the testing scenarios and I haven't found any issues or regressions
  • Whenever I took a non-obvious choice I added a comment explaining why I did it this way
  • I added the label One Review Required if the PR introduces only minor changes, does not contain any architectural changes or does not introduce any new patterns and I think one review is sufficient'
  • PR title is human readable and could be used in changelog

@tianrunhe tianrunhe marked this pull request as draft November 14, 2023 20:40
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.

None yet

1 participant