<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Soumyadip Maity</title>
    <description>The latest articles on DEV Community by Soumyadip Maity (@soumyadip_maity_2025).</description>
    <link>https://dev.to/soumyadip_maity_2025</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3962611%2F481e500e-9fde-4abc-8e7f-eab9c454ef92.jpg</url>
      <title>DEV Community: Soumyadip Maity</title>
      <link>https://dev.to/soumyadip_maity_2025</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/soumyadip_maity_2025"/>
    <language>en</language>
    <item>
      <title>I Was Tired of Sending My Users' Data to Google — So I Built My Own Analytics</title>
      <dc:creator>Soumyadip Maity</dc:creator>
      <pubDate>Mon, 01 Jun 2026 11:26:23 +0000</pubDate>
      <link>https://dev.to/soumyadip_maity_2025/i-was-tired-of-sending-my-users-data-to-google-so-i-built-my-own-analytics-2okg</link>
      <guid>https://dev.to/soumyadip_maity_2025/i-was-tired-of-sending-my-users-data-to-google-so-i-built-my-own-analytics-2okg</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.tourl"&gt;&lt;/a&gt;I'm a final year CS student. I build things in production.&lt;/p&gt;

&lt;p&gt;Last year, I was working on &lt;strong&gt;[Ucoder](&lt;a href="https://www.ucoder.in" rel="noopener noreferrer"&gt;https://www.ucoder.in&lt;/a&gt;&lt;/strong&gt;) — a full-stack platform I've been building since college. At some point I needed analytics. I wanted to know: are people actually using this? Which features are being used? Where are errors happening?&lt;/p&gt;

&lt;p&gt;So I did what everyone does. I installed Google Analytics.&lt;/p&gt;

&lt;p&gt;It worked. But something felt wrong.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;GA4 sends every user interaction to Google's servers. Every click, every session, every user's IP and device — all of it leaves your infrastructure and goes somewhere you don't control.&lt;/p&gt;

&lt;p&gt;For a platform where I cared about user trust, that felt like a betrayal.&lt;/p&gt;

&lt;p&gt;So I looked at alternatives:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Plausible&lt;/strong&gt; — privacy-first, cookie-free, clean dashboard. But it only gives you pageviews, referrers, and bounce rate. No custom events, no error tracking, no real product analytics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mixpanel&lt;/strong&gt; — powerful, but $28/month per 10K users. At scale, brutal. And the setup takes half a day just for event taxonomy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Microsoft Clarity&lt;/strong&gt; — session replays and heatmaps only. No event tracking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Self-hosted Matomo&lt;/strong&gt; — closer, but heavy to maintain and the UI feels dated.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of them did what I actually needed:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Track real user behavior, capture errors, support custom events — without cookies, without sending data to a third party, and without a painful setup.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So I built it myself.&lt;/p&gt;




&lt;h2&gt;
  
  
  Introducing Ucoder Insights
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://insights.ucoder.in" rel="noopener noreferrer"&gt;Ucoder Insights&lt;/a&gt;&lt;/strong&gt; is a privacy-first, cookie-free analytics platform with its own npm SDK.&lt;/p&gt;

&lt;p&gt;It tracks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📄 Page views (SPA-aware, works with Next.js, React, Vue)&lt;/li&gt;
&lt;li&gt;⚡ Custom events&lt;/li&gt;
&lt;li&gt;🔴 JavaScript errors (with stack traces)&lt;/li&gt;
&lt;li&gt;📊 Core Web Vitals (LCP, FID, CLS)&lt;/li&gt;
&lt;li&gt;🌐 Referrers, UTM params, device/browser info&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All without cookies. All processed on your own terms.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works — Technical Overview
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The SDK
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;ucoder-insight
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;initUcoderInsight&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ucoder-insight&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;initUcoderInsight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;projectid&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Your optional settings here&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. One function call. No configuration overhead.&lt;/p&gt;

&lt;p&gt;The SDK is ~9.5KB gzipped. It uses a &lt;strong&gt;beacon API&lt;/strong&gt; to send events so it never blocks the main thread. For SPAs, it listens to &lt;code&gt;history.pushState&lt;/code&gt; and &lt;code&gt;popstate&lt;/code&gt; to track client-side navigation automatically.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Backend Architecture
&lt;/h3&gt;

&lt;p&gt;The backend is built with &lt;strong&gt;Express 5 + TypeScript&lt;/strong&gt;. When an event comes in:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Request hits the Express API&lt;/li&gt;
&lt;li&gt;Passes through &lt;code&gt;express-validator&lt;/code&gt; for input sanitisation&lt;/li&gt;
&lt;li&gt;Gets pushed into a &lt;strong&gt;BullMQ job queue&lt;/strong&gt; backed by &lt;strong&gt;Redis&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A background worker processes the queue and writes to &lt;strong&gt;MongoDB&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Why a queue? Because analytics should never slow down your app. If the ingestion endpoint is under load, events queue up and get processed asynchronously — your tracked application is never affected.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client SDK
   │
   ▼
Express API  ──→  BullMQ Queue (Redis)
                       │
                       ▼
                  Worker Process
                       │
                       ▼
                   MongoDB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Privacy by Design
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No cookies&lt;/strong&gt; — identification uses a daily-rotated hash of IP + User-Agent. No persistent tracking across days.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No PII storage&lt;/strong&gt; — we never store  IPs or personal data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your data stays yours&lt;/strong&gt; — events go to your project only, not a shared Google/Meta data warehouse.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What This Solves That Others Don't
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Error Tracking + Analytics in One Place
&lt;/h3&gt;

&lt;p&gt;With GA4 or Plausible, you need a separate tool (Sentry, LogRocket) for error tracking. With Ucoder Insights, JavaScript errors are captured automatically — with the page URL, user agent, and stack trace — right alongside your pageview and event data.&lt;/p&gt;

&lt;p&gt;No context switching between dashboards.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Real Custom Events, Simply
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;trackEvent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ucoder-insight&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Track anything&lt;/span&gt;
&lt;span class="nf"&gt;trackEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;signup_completed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;free&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nf"&gt;trackEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;feature_used&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;feature&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;export_csv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Plausible's custom events require manual script tagging. Mixpanel requires you to plan an entire event taxonomy before you start. Here, you call one function.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. SPA-First
&lt;/h3&gt;

&lt;p&gt;Most analytics tools were built for traditional multi-page websites. Ucoder Insights was built with SPAs in mind from day one — it handles &lt;code&gt;pushState&lt;/code&gt; navigation, React Router, Next.js App Router, and hash-based routing out of the box.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SDK&lt;/td&gt;
&lt;td&gt;TypeScript, Beacon API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Frontend Dashboard&lt;/td&gt;
&lt;td&gt;Next.js 16, React 19, Tailwind CSS 4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend&lt;/td&gt;
&lt;td&gt;Express 5, TypeScript, Socket.IO&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Queue&lt;/td&gt;
&lt;td&gt;BullMQ + Redis (ioredis)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;MongoDB (Mongoose 9)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployment&lt;/td&gt;
&lt;td&gt;Docker + PM2 on Linux VPS&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Current Status
&lt;/h2&gt;

&lt;p&gt;The platform is live at &lt;strong&gt;&lt;a href="https://insights.ucoder.in" rel="noopener noreferrer"&gt;insights.ucoder.in&lt;/a&gt;&lt;/strong&gt; and running in production on Ucoder.in.&lt;/p&gt;

&lt;p&gt;The npm package &lt;strong&gt;&lt;a href="https://www.npmjs.com/package/ucoder-insight" rel="noopener noreferrer"&gt;ucoder-insight&lt;/a&gt;&lt;/strong&gt; is public at v1.1.3.&lt;/p&gt;

&lt;p&gt;I'm a solo developer and this is a real project — not a side project I'll abandon. I use it myself, which means I have a real incentive to keep it working and improving.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Coming Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Alert system&lt;/strong&gt; — get notified on Slack/email when error rate spikes or traffic drops&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server-side proxy&lt;/strong&gt; — bypass ad-blockers without compromising privacy&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Funnel analysis&lt;/strong&gt; — visualise conversion paths across custom events&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API access&lt;/strong&gt; — pull your analytics data into your own dashboards&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;ucoder-insight
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;🔗 &lt;strong&gt;Platform:&lt;/strong&gt; &lt;a href="https://insights.ucoder.in" rel="noopener noreferrer"&gt;insights.ucoder.in&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/ucoder-insight" rel="noopener noreferrer"&gt;npmjs.com/package/ucoder-insight&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;💻 &lt;strong&gt;My portfolio:&lt;/strong&gt; &lt;a href="https://soumyadip.ucoder.in" rel="noopener noreferrer"&gt;soumyadip.ucoder.in&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're building something and tired of sending your users' data to Google — give it a try. And if you have feedback, I genuinely want to hear it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built by Soumyadip Maity — Full Stack Developer, final year CS student, West Bengal, India.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>opensource</category>
      <category>showdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
