Trackio is a lightweight, open-source email tracking system built with a Chrome Extension and a Next.js dashboard.
It injects an invisible tracking pixel into your Gmail compose window and notifies you the moment someone opens your email — with open counts, timestamps, and detailed analytics.
- Features
- Tech Stack
- Directory Structure
- How It Works
- Download & Setup the Extension
- Clone, Setup & Run Locally
- Contributing
| Feature | Description |
|---|---|
| Real-time open tracking | Know the instant someone reads your email. |
| Open count & timestamps | See how many times an email was opened and when. |
| Chrome Extension for Gmail | Seamlessly integrates into Gmail's compose window with zero friction. |
| Tracking indicator | A small orange "Trackio" badge appears in your compose toolbar so you know tracking is active. |
| Sent folder checkmarks | ✓ gray (sent, not opened) and ✓✓ orange (opened) icons appear next to tracked emails in your Sent folder. |
| Desktop notifications | Get a Chrome notification when someone opens your email. |
| Self-open prevention | Smart multi-layer system ensures your own views don't count as opens. |
| Beautiful dashboard | Clean, modern UI to view all tracked emails, stats, open rates, and history. |
| Google SSO | Sign in with your Google account in one click. |
| Persistent sessions | Stay logged in until you explicitly sign out. |
| Vercel Analytics | Built-in page view and visitor tracking. |
| Fully open source | Inspect, fork, and contribute. |
| Layer | Technology |
|---|---|
| Frontend / Dashboard | Next.js 16, React 19, Tailwind CSS 4, shadcn/ui |
| Backend / API | Next.js API Routes (serverless on Vercel) |
| Database | PostgreSQL (Neon) via Prisma ORM 7 |
| Authentication | NextAuth.js v5 (Google SSO) with Prisma Adapter |
| Chrome Extension | Manifest V3, Vanilla JS |
| Deployment | Vercel (web), GitHub (extension ZIP) |
| Analytics | Vercel Analytics |
The project is a monorepo with two main directories:
Trackio/
├── extension/ # Chrome Extension (Manifest V3)
│ ├── manifest.json # Extension config, permissions, content scripts
│ ├── background.js # Service worker — API calls, polling, notifications,
│ │ # declarativeNetRequest self-open blocking
│ ├── content.js # Injected into Gmail — compose detection, send
│ │ # interception, pixel injection, checkmarks
│ ├── popup.html/js/css # Extension popup — toggle, stats, connection status
│ ├── styles.css # Injected CSS for Gmail (indicator, checkmarks)
│ └── icons/ # Extension icons (16, 32, 48, 128px)
│
├── web/ # Next.js Web Application
│ ├── app/
│ │ ├── page.tsx # Landing page
│ │ ├── login/page.tsx # Google SSO login page
│ │ ├── dashboard/ # Dashboard (server + client components)
│ │ ├── layout.tsx # Root layout (providers, analytics, toaster)
│ │ ├── globals.css # Global styles (system fonts, Tailwind)
│ │ └── api/
│ │ ├── auth/[...nextauth]/route.ts # NextAuth API
│ │ ├── emails/route.ts # Register & fetch tracked emails
│ │ ├── emails/check/route.ts # Bulk status check (polling)
│ │ ├── track/[id]/route.ts # Tracking pixel endpoint
│ │ └── track/[id]/self-view/route.ts # Self-view compensation
│ ├── lib/
│ │ ├── auth.ts # NextAuth config (Google provider, Prisma adapter)
│ │ ├── prisma.ts # Prisma client singleton (Neon adapter)
│ │ ├── cors.ts # CORS helpers for extension ↔ API
│ │ └── utils.ts # Utility functions
│ ├── components/ # UI components (shadcn/ui + custom)
│ ├── prisma/
│ │ └── schema.prisma # Database schema (User, Email, OpenEvent, etc.)
│ ├── middleware.ts # Route protection
│ └── package.json # Dependencies & scripts
│
├── trackio_extension.zip # Pre-packaged extension for download
└── README.md
-
The extension runs entirely in the browser. It uses a content script (
content.js) injected into Gmail to detect compose windows, intercept the Send button, inject a 1×1 tracking pixel, and display open status checkmarks in the Sent folder. -
The background service worker (
background.js) handles all API communication, polls for open events, sends desktop notifications, and usesdeclarativeNetRequestto block compose-time self-opens.
-
The web app serves two purposes: (1) a public-facing landing page and dashboard for viewing tracked email analytics, and (2) a set of API routes that the extension communicates with — registering emails, serving tracking pixels, checking open status, and handling self-view compensation.
-
Authentication is handled via Google SSO (NextAuth.js) and data is stored in a PostgreSQL database (Neon) using Prisma ORM.
High-level flow:
-
User composes an email in Gmail → The content script detects the compose window and intercepts the Send button.
-
Send is clicked → The extension registers the email with the Trackio API (
POST /api/emails), which returns a unique tracking ID and pixel URL. -
Pixel is injected → A 1×1 transparent GIF
<img>tag is appended to the email body. AdeclarativeNetRequestrule blocks Gmail from loading it during compose (preventing self-opens). -
Email is sent → Gmail sends the email with the pixel embedded in the HTML body.
-
Recipient opens the email → Their email client (or its image proxy) fetches the pixel from
GET /api/track/{id}. The server records anOpenEvent, increments the open count, and marks the email as "opened". -
Extension polls for updates → Every 30 seconds, the background service worker checks for new opens via
POST /api/emails/checkand shows a Chrome desktop notification if there are new opens. -
Dashboard reflects data → The web dashboard fetches tracked emails from
GET /api/emailsand displays stats, open counts, and last-opened timestamps. -
Self-open prevention → If the user views their own sent email, the extension reports a self-view to
POST /api/track/{id}/self-viewwith asenderToken, and the server marks that open event as a self-open (excluded from counts).
⚠️ I don't currently have a Google Developer license to publish extensions on the Chrome Web Store. So you'll need to manually load the extension as an unpacked package. It takes less than a minute!
Download the extension ZIP file from GitHub:
👉 Download trackio_extension.zip
Click the "Download raw file" button (↓) on the GitHub page.
-
Windows: Right-click the ZIP → "Extract All" → Choose a folder (e.g.,
Desktop/trackio_extension). -
Mac: Double-click the ZIP file. It'll create a folder automatically.
-
Linux:
unzip trackio_extension.zip -d trackio_extension
- Open Chrome and go to
chrome://extensions. - Enable "Developer mode" (toggle in the top-right corner).
- Click "Load unpacked".
- Select the extracted folder (the one containing
manifest.json, NOT the ZIP file). - Trackio should now appear in your extensions list with the orange icon.
Click the puzzle piece icon (🧩) in Chrome's toolbar → Find "Trackio" → Click the pin icon so it's always visible.
- Open Gmail.
- Compose a new email — you should see the orange "Trackio" badge in the compose toolbar.
- Send the email as usual.
- Open the extension popup to see your tracked stats, or visit the Trackio Dashboard.
- Node.js ≥ 18
- npm or yarn
- Google Cloud Console project with OAuth 2.0 credentials
- PostgreSQL database (or use Neon for free)
git clone https://github.com/ayushkcs/Trackio.git
cd Trackiocd web
npm installCreate a .env file in the web/ directory:
# Database
DATABASE_URL="postgresql://user:password@host/dbname?sslmode=require"
# NextAuth
AUTH_SECRET="your-random-secret-string"
# Google OAuth
GOOGLE_CLIENT_ID="your-google-client-id.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
# App URL (no trailing slash)
NEXT_PUBLIC_APP_URL="http://localhost:3000"To get Google OAuth credentials:
- Go to Google Cloud Console.
- Create a new project (or use an existing one).
- Navigate to APIs & Services → Credentials → Create Credentials → OAuth Client ID.
- Set Application type to Web application.
- Add
http://localhost:3000to Authorized JavaScript origins. - Add
http://localhost:3000/api/auth/callback/googleto Authorized redirect URIs. - Copy the Client ID and Client Secret into your
.env.
npx prisma db pushThis creates all the necessary tables in your database.
npm run devThe app will be running at http://localhost:3000.
- Open
chrome://extensionsin Chrome. - Enable Developer mode.
- Click "Load unpacked" → Select the
extension/folder from the cloned repo. - The extension will connect to
http://localhost:3000by default for local development.
- Sign in with Google at http://localhost:3000.
- Open Gmail and send a tracked email.
- Check the dashboard at http://localhost:3000/dashboard.
Contributions are welcome! Whether it's a bug fix, feature request, or documentation improvement — feel free to open an issue or submit a pull request.
- Fork this repository.
- Create a branch:
git checkout -b feature/my-awesome-feature - Commit your changes:
git commit -m "feat: add my awesome feature" - Push:
git push origin feature/my-awesome-feature - Open a Pull Request and describe your changes.
Please keep your PRs focused and follow the existing code style.






