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

Fixed homepage visitor counter to track unique visits only once per user session #93

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

ygowthamr
Copy link
Contributor

#PR: Fixed homepage visitor counter to track unique visits only once per user session

Fix #92

Description

This PR addresses the issue where the visitor count increments each time a user returns to the homepage, even if they have already been counted. The visitor count now only increments on the first visit per user session, ensuring each visitor is counted only once.

Changes Made

  • Added a check using localStorage to track if a user has already visited the homepage.
  • If the visitedHomePage flag is not set, the visitor count is incremented, and the flag is set in localStorage.
  • Subsequent visits in the same session do not increment the counter, preserving the unique count.

Testing

  • Verified that the visitor count increments only once per session.
  • Tested multiple navigations back to the homepage; count remains stable after the initial increment.

This update ensures accurate visitor tracking by counting each user only once per session.

@Akshat111111
Pls assign this, give me labels, level.

Copy link
Owner

@Akshat111111 Akshat111111 left a comment

Choose a reason for hiding this comment

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

Remove the conflicts first

@ygowthamr
Copy link
Contributor Author

ygowthamr commented Nov 4, 2024

@Akshat111111 Resolved issues please merge my PR.

@ygowthamr
Copy link
Contributor Author

@Akshat111111 Resolved conflicts pls merge my PR.

Copy link
Owner

@Akshat111111 Akshat111111 left a comment

Choose a reason for hiding this comment

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

fine!!

Copy link

github-actions bot commented Nov 5, 2024

🎉🎉 Thank you for your contribution! Your PR #93 has been merged! 🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update homepage visitor counter to track unique visitors
2 participants