DEV Community

Gkspace
Gkspace

Posted on

I built a notification tool — then used it to track clicks on my own marketing page

I built Flarely to solve a specific problem: getting notified when things happen in your app — a payment fails, a cron job finishes, an error spikes. The idea was simple: one HTTP endpoint, any event, routed to Discord/Slack/Telegram/Email.

What I didn't expect was that the first interesting use case I found for it was on my own marketing page.

The problem

After launching, I had basic Netlify analytics — pageviews, unique visitors. But I had no idea what people were actually doing on the page. Were they clicking "Start free"? Were they scrolling past the pricing section and bouncing? Were they clicking the GitHub link instead of signing up?

Netlify's free tier doesn't tell you that. PostHog/Mixpanel felt like overkill for what I needed. I just wanted to know: did anyone click this button today?

Then it occurred to me — I already have a tool that sends me a message when something happens.

Dogfooding it

I added a trackClick function to the landing page

function trackClick(label: string) {
  fetch('https://app.getflarely.dev/v1/ingest', {
    method: 'POST',
    keepalive: true, // survives page navigation
    headers: {
      'Authorization': `Bearer ${process.env.NEXT_PUBLIC_FLARELY_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      title: `Landing: ${label}`,
      message: `Someone clicked "${label}" on getflarely.dev`,
      level: 'info',
      source: 'flarely-landing',
      fingerprint: `click-${label}-${Math.floor(Date.now() / 60000)}`,
    }),
  }).catch(() => {})
}
Enter fullscreen mode Exit fullscreen mode

The keepalive: true is important — without it, the fetch gets cancelled the moment the browser navigates away from the page. The fingerprint deduplicates repeat clicks within a 60-second window so one person rage-clicking doesn't flood Discord.

Then on every CTA:

<a href="https://app.getflarely.dev/login" onClick={() => trackClick('Start free — hero')}>
  Start free
</a>
Enter fullscreen mode Exit fullscreen mode

Now every time someone clicks a CTA on my landing page, I get a Discord message. No analytics dashboard, no funnel setup, no event schema to define. Just a message that says "Someone clicked 'Start free — hero' on getflarely.dev".

What it changed

Two things happened when I wired this up.

First, I got actual signal. 43 unique visitors in a day, 0 clicks on any CTA. That's not a tracking bug — that's a conversion problem. It changed what I worked on next.

Second, it made me rethink how I'd been positioning the product. I'd been describing Flarely as "error and event notifications" — leading with errors. But here I was using it for click tracking on a marketing page. No errors involved. It's just a general-purpose "I want to know when X happens" tool.

The name "event notification" is right. The leading-with-errors framing was wrong. I updated the homepage copy and README after this.

The broader point

Most developers have more "things I want to know about" than they have infrastructure for. You add console.log calls you'll never read. You check a dashboard once then forget about it. You promise yourself you'll set up alerting "later".

The thing that actually gets you to act is a message landing in the place you already check — Discord, Slack, your phone. The lower the friction between "something happened" and "I know about it", the more likely you'll actually close the loop.

A curl is enough:

curl -X POST https://app.getflarely.dev/v1/ingest \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"title": "Cron job completed", "level": "info", "source": "my-server"}'
Enter fullscreen mode Exit fullscreen mode

Flarely is open source (github.com/flarely/flarely) and has a free cloud tier — 500 events/month, no credit card. Self-host it if you prefer.

That's it. Sometimes the best validation for a tool is finding yourself using it in a way you didn't design for.

Top comments (0)