ruanyf/user-tracking-demos — explained in plain English
Analysis updated 2026-07-17 · repo last pushed 2019-04-15
Compare five different ways to send user tracking data and see which is most reliable.
Learn how browsers handle network requests when a page is closing or unloading.
Decide which tracking method to use in your own website's analytics implementation.
Run local demo pages and watch server logs to see which methods actually capture events.
| ruanyf/user-tracking-demos | terkelg/skaler | jimliu/baoyu-design | |
|---|---|---|---|
| Stars | 91 | 91 | 90 |
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | 2019-04-15 | 2020-03-15 | — |
| Maintenance | Dormant | Dormant | — |
| Setup difficulty | easy | easy | easy |
| Complexity | 2/5 | 1/5 | 2/5 |
| Audience | developer | developer | vibe coder |
Figures from each repo's GitHub metadata at analysis time.
Detailed technical explanations are only available in the author's Chinese-language blog post.
This repository demonstrates different ways to track what users do on a website by sending that information back to a server. It's useful if you're building analytics, monitoring user behavior, or understanding how websites collect data about their visitors. The repo contains five different methods for accomplishing this tracking, each with tradeoffs. Some methods send data immediately when a user performs an action, while others wait or batch multiple events together. Some work even if the user closes the page mid-request. The goal is to show developers the pros and cons of each approach, for example, one method might be faster but less reliable, while another guarantees delivery but might slow down the page. To use it, you clone the repository, install its dependencies, and run a local server on your computer. Then you visit the demo pages in your browser, interact with them (clicking buttons or navigating away), and watch the server logs in your terminal to see which tracking methods actually captured your actions. It's hands-on learning: you immediately see what worked and what didn't. This would be valuable for anyone building a website or app who wants to understand the mechanics of user tracking, especially if you're trying to decide which method to use in your own project. It's also helpful for learning how the browser communicates with servers in different scenarios, like when a page is unloading or the connection is slow. The author included a blog article (in Chinese) with more detailed explanations of the technical concepts behind each method.
A hands-on demo repo showing five different ways to send user behavior tracking data from a browser to a server, with tradeoffs for each.
Mainly JavaScript. The stack also includes JavaScript, Node.js.
Dormant — no commits in 2+ years (last push 2019-04-15).
Open-source demo code you can freely clone and learn from, check the repo's license file for exact reuse terms.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.