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 #666

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

ygowthamr
Copy link
Contributor

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

Fix #656

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.

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

Copy link

github-actions bot commented Nov 4, 2024

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our chaotic CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

Copy link

netlify bot commented Nov 4, 2024

Deploy Preview for thunderous-starlight-9c463d ready!

Name Link
🔨 Latest commit a5d6e29
🔍 Latest deploy log https://app.netlify.com/sites/thunderous-starlight-9c463d/deploys/6728e1d39e355300083af89c
😎 Deploy Preview https://deploy-preview-666--thunderous-starlight-9c463d.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 4, 2024

Deploy Preview for alienid ready!

Name Link
🔨 Latest commit a5d6e29
🔍 Latest deploy log https://app.netlify.com/sites/alienid/deploys/6728e1d3949dd300087aa623
😎 Deploy Preview https://deploy-preview-666--alienid.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@YadavAkhileshh YadavAkhileshh merged commit f688d7c into YadavAkhileshh:main Nov 4, 2024
8 of 9 checks passed
Copy link

github-actions bot commented Nov 4, 2024

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

@YadavAkhileshh YadavAkhileshh added gssoc24 gssoc-ext New feature or request level2 level3 and removed level2 labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc24 gssoc-ext New feature or request level3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature : Update homepage visitor counter to track unique visitors
2 participants