Lightweight Telemetry: Count Visitors with Pixel and Simple Requests
· 阅读需 3 分钟
When you just need to confirm real visitor volume without heavy SDKs, cookies, or complex pipelines, a 1x1 pixel or a minimal request is enough. Tianji supports this lightweight telemetry pattern to help you validate traffic safely and reliably.
What This Telemetry Is (and Is Not)
- It is a simple “signal” that a human likely visited a page or executed an action.
- It is not OpenTelemetry, tracing, or deep behavioral analytics.
- It favors privacy and performance over granularity.
Common use cases:
- Confirming documentation traffic and marketing landing page reach
- Basic pageview counting for self-hosted sites
- Minimal conversion confirmation (e.g., signup success page)
Option 1: Image Pixel (No JavaScript)
Embed a 1x1 pixel that calls your collector endpoint. The server increments counters based on request metadata.
<!-- Simple pixel beacon: uses GET and works without JS -->
<img
src="https://your-domain.example/api/telemetry/pixel?site=docs&path=/getting-started&ts=1690000000000"
width="1"
height="1"
alt=""
referrerpolicy="strict-origin-when-cross-origin"
loading="eager"
/>
Server recommendations:
- Count unique visits by a rolling fingerprint from IP range + User-Agent + truncated time bucket
- Return
Cache-Control: no-storeto avoid CDN/browser caching - Use
204 No Contentand a tiny transparent GIF/PNG if needed