Why not just use websockets? I use socket.io on my site. I keep track of socket IDs in memory, if a connection is lost, I get a disconnect event, and vice versa. Socket events are sent to users when the number changes.<p>I manage the frequency of socket emits using RxJS, to prevent sending too many changes to users.<p><a href="https://movinggauteng.co.za" rel="nofollow">https://movinggauteng.co.za</a>, there's a counter at the top of the page.<p>EDIT: Only saw a comment about why the OP used Ajax after posting this.
Is using ajax calls on a loop the best way to track users on a site? I'm curious because when I look at pages using google analytics I don't see any repeating requests in the network console. Does google mask the requests or use some other protocol?
Hey all.<p>Last week Marc Kohlbrugge launched <a href="https://highscore.money/" rel="nofollow">https://highscore.money/</a>. Following that, he sent out a tweet, asking if anyone knew of a good real time user counter to add to his site.<p><a href="https://twitter.com/marckohlbrugge/status/737388891246891008" rel="nofollow">https://twitter.com/marckohlbrugge/status/737388891246891008</a><p>No-one did, so we made one.<p>Real Time Users is just that. We made it this weekend. I wrote a quick post introducing it, so feel free to look at that for more details.<p><a href="https://blog.wearecontrast.com/make-stuff-ff82f78cf5a9#.s8mggqigh" rel="nofollow">https://blog.wearecontrast.com/make-stuff-ff82f78cf5a9#.s8mg...</a><p>Feel free to ask any questions, I'll be about all day.
<a href="https://bycontrast.co/" rel="nofollow">https://bycontrast.co/</a> is just a "hello world", is there a normal site for that
So actually nobody bothered to Google for that ?<p><a href="https://www.google.com/search?q=user+counter" rel="nofollow">https://www.google.com/search?q=user+counter</a> brings many websites offering this in various fonts, sizes and colors.<p>But then again, 'good' can be very subjective...