Add metrics tracking for game completions and daily player stats - #85
Open
Osireg17 wants to merge 2 commits into
Open
Add metrics tracking for game completions and daily player stats#85Osireg17 wants to merge 2 commits into
Osireg17 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds new metrics tracking and reporting features to the application, including tracking game completion events and displaying the daily player count. It introduces utility functions and components for handling anonymous user identification and fetching player statistics, and integrates these into the game flow.
Metrics tracking and reporting:
UuidUtilutility inuuid-util.tsto generate and persist a unique anonymous user ID in local storage for tracking purposes.game.tsxto send a POST request to the metrics service when a game is completed or the guess limit is reached, including user UUID, passage ID, stars, guesses, and win status. (src/app/play/[game]/game.tsxR23, src/app/play/[game]/game.tsxR237-R255)track-completion.tsto send completion events to the metrics service, supporting both logged-in and anonymous users.Player statistics display:
PlayerCountclient component that fetches and displays the number of players for the current day, refreshing every 5 minutes.get-daily-stats.tsto fetch daily player statistics from the metrics service, and defined theDailyPlayerStatsmodel. [1] [2]