A feather-light, privacy-respecting, GDPR-compliant visitor counter that shows you how many users are on the page right now. No creepy tracking, no personal data.
- Privacy Respecting: No cookies or personally identifiable information are ever used or stored.
- GDPR Compliant: Helps you meet your privacy compliance goals effortlessly.
- Simple & Minimal: Just one line of HTML and one script tag. The counter is unstyled by default, giving you complete control over its appearance.
- Lightweight: The script is tiny (1kb) and loads asynchronously so it won't slow down your site.
Place this <span> tag wherever you want the counter to appear on your page. The script will automatically find it by its class name.
<span class="herenow">1 user here now</span>Add this script tag just before the closing </body> tag on your page. The defer attribute ensures it won't block your page from loading.
<script src="https://wgx.github.io/herenow/herenow.min.js" defer></script>The counter is unstyled by default. If you'd like to create a styled badge with a pulsing dot, you can use the CSS below.
CSS:
.herenow-container {
display: inline-flex;
align-items: center;
gap: 0.5rem;
background-color: #f0f2f5;
padding: 0.5rem 1rem;
border-radius: 9999px;
}
.dot {
width: 0.75rem;
height: 0.75rem;
background-color: #22c55e;
border-radius: 50%;
animation: pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
50% { opacity: .5; }
}HTML Structure:
With the dot:
<div class="herenow-container">
<span class="dot"></span>
<span class="herenow">1 user here now</span>
</div>Or just plain text:
<span class="herenow">1 user here now</span>