SShortSingh.
Back to feed

How to Track Referral Sources Without Storing Raw URLs or UTM Strings

0
·1 views

A developer working on RetroPrompt, a web tool for generating portraits, has shared a privacy-conscious approach to referral attribution that avoids storing raw referrer URLs or arbitrary UTM parameters. The method classifies incoming traffic into fixed source categories — such as known search engines, publishing platforms, or an 'other_referral' bucket — by parsing hostnames against an explicit allowlist rather than using substring matching. To preserve attribution across a user session without tracking individuals, the implementation ties entry labels to a short-lived, random tab-session identifier that expires after 30 minutes of inactivity. The author notes that this approach has clear limits: two open tabs can generate separate sessions, and the metric is not equivalent to unique visitors or long-term retention figures reported by other analytics tools. The article emphasizes that attribution labels serve as bookkeeping aids, not proof of causation, and that missing or unrecognized attribution should remain visible rather than be silently discarded.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

How to verify drand randomness beacons in your app using 30 lines of code

Developers building agents that rely on random numbers often use HTTP relay APIs, but these relays cannot be independently trusted to deliver unaltered data. The drand project, operated by the League of Entropy, publishes a public randomness beacon every three seconds using BLS signatures, allowing anyone to verify results offline with a pinned public key. By fetching the same round directly from drand's own endpoint and comparing it against the relay's response, developers can confirm the beacon has not been tampered with or replayed. A small code example using the drand-client npm package demonstrates how to perform this cross-verification in under 30 lines. The approach reduces reliance on relay trust and enables reproducible, auditable random sampling for use cases like reviewer selection, tie-breaking, or raffles.

0
ProgrammingDEV Community ·

Developer releases npm tool to auto-generate aligned comment dividers in code

A developer frustrated with manually aligning comment-based section dividers in code files has published an open-source npm package called code-divider. The tool replaces lightweight inline markers like @reg and @sec with fully formatted, centered header blocks that consistently end at column 79. Users can run it from the command line, point it at a specific file or directory, or configure it to trigger automatically on save via editor extensions. The package supports over a dozen languages including TypeScript, Python, Go, Rust, and SQL, using each language's native comment syntax. Unlike editor snippets, the tool dynamically sizes the filler characters around each label so all headers remain uniform regardless of label length.

0
ProgrammingDEV Community ·

12-Week Roadmap Outlines How Developer Tools Should Use Full Repo Context

A newly published 12-week Developer Tools and Code Intelligence roadmap lays out a structured approach to building smarter, safer developer tooling. The plan begins with code review, static and dynamic analysis, and testing infrastructure as distinct but complementary evidence sources. A middle phase focuses on repository context, including codebase graphs, blast-radius analysis, and IDE or CLI integration to reflect real workflows. The final phase introduces coding agents, supply-chain health checks, and automated remediation, with an emphasis on transparency around why changes are suggested and how outcomes will be verified. The roadmap argues that effective developer tools must be repository-aware rather than generic, with measurable value and clearly visible limitations.

0
ProgrammingDEV Community ·

How Multi-Agent AI Swarms Cut a 45-Minute Task to Minutes Using Hive Logic

Software engineer Derek Wang argues that running AI agents serially creates a hard ceiling on efficiency, with elapsed time growing linearly and coordination costs mounting quickly. Drawing on Kevin Kelly's observations about decentralised bee colonies, Wang proposes splitting large tasks into independent parallel subtasks rather than relying on a single sequential agent. Instead of a central scheduler, his team adopted a work-stealing model where idle agents pull jobs from busier agents' queues, eliminating the bottleneck of fixed task assignment. A recurring failure mode — agents hanging unattended and wasting 30-plus minutes before human intervention — was resolved by adding a watchdog that automatically detects stalled agents, redistributes their work, and recovers within five minutes. Wang frames the key insight as structural: parallel task design provides automatic fault recovery, not just speed gains.