DEV Community

Cover image for How I Built a Click Tracking System Without Cookies or Complex Setup
David🚀
David🚀

Posted on • Edited on

How I Built a Click Tracking System Without Cookies or Complex Setup

For months, I thought I knew where my users were coming from.

I’d post in a subreddit, reply to a thread on X, drop a link in a community… then check my analytics.

Google Analytics would tell me:

  • Direct
  • Social

Which basically means 🤷🏽 not helpful at all.

The result? I kept doubling down on channels that weren’t actually working, while ignoring the ones that were quietly bringing signups.

In early-stage SaaS, a few weeks of guessing can be the difference between growing and giving up.


Why I Didn’t Use Google Analytics

For me, it came down to three big problems:

  1. Setup overhead – too much bloat for a small side project.
  2. Privacy concerns – cookies, consent banners, tracking scripts I didn’t feel great about adding.
  3. Vague reporting – "Direct" or Social isn't actionable when you need to know exactly which post or link brought someone in.

I wanted something that was:

  • Dead simple to set up.
  • Cookie-less and privacy-friendly.
  • Laser-focused on the one question: “Where did this click come from?”

The Core Idea

What if I created a unique link for every place I posted?
That way, I could:

  • Redirect users to my site.
  • Log exactly where they came from.
  • Group those links into campaigns for quick comparison.

The Build

I kept the architecture simple:

Stack

  • Supabase PostgreSQL for storing links and click logs
  • Next.js

Database schema (simplified)

-- Links table
id | original_url | campaign_name | tag | click_count

-- Visits table
id | link_id | timestamp | referrer

Enter fullscreen mode Exit fullscreen mode

The redirect endpoint

// pages/api/track/[id].js
import { supabase } from '../../lib/supabase'

export default async function handler(req, res) {
  const { id } = req.query
  await supabase.from('clicks').insert({ link_id: id, referrer: req.headers.referer })
  const { data } = await supabase.from('links').select('url').eq('id', id).single()
  res.redirect(data.url)
}

Enter fullscreen mode Exit fullscreen mode

No cookies. No personal data. Just a timestamp and referrer.


Privacy-First by Design

Here’s what I decided NOT to do:

  • ❌ No cookies or localStorage.
  • ❌ No IP address logging.
  • ❌ No fingerprinting or hidden tracking.

Instead, I store only:

  • The link ID.
  • The time it was clicked.
  • The referrer (if available). That’s it.

The Result

Within the first week of using this system, I found out:

  • 70% of my signups came from showcase on X.
  • A channel I thought was working? 0 users. Now, I double down on what’s actually driving results, no guesswork.

From Side Project to Tool

I ended up turning this into a simple SaaS called Reddimon so other founders can:

  • Track exactly which post, comment, or link brings them users.
  • Do it without cookies or heavy setup.
  • Focus only on marketing that works.

If you’re tired of “Direct / Unknown” in your analytics, you might like it.

Top comments (0)