Skip to content
allimistPublic

About

Chrome extension to inspect marketing attribution, tracking parameters, cookies, redirects and pixel requests. 100% client-side, no telemetry.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TrackLens β€” client-side tracking debugger

A Chrome extension that shows you exactly how a page is tracking, attributing and redirecting β€” with zero data leaving your browser.


Manifest V3 Built with React TypeScript Vite 100% Client-side No Telemetry License: MIT


Installation Β· Features Β· How it works Β· Demo Β· Privacy Β· Roadmap


🎯 Why TrackLens?

Marketing attribution breaks silently. A fbclid gets stripped by a redirect, a _fbc cookie never gets set, a pixel fires three times, a UTM disappears after a consent banner reload β€” and nobody notices until the reports look wrong.

TrackLens puts a lens on the current tab and shows you the whole attribution picture in one popup: URL parameters, cookies, storage, the redirect chain, and every tracking request from the major ad platforms. It then flags the common failure patterns and gives you a health score.

No backend. No account. No API key. No telemetry. Everything runs inside Chrome.


✨ At a glance

πŸ”Ž Parameters Every query param, with ad-tech IDs recognised
πŸͺ Cookies All cookies for the current URL
πŸ—„οΈ Storage LocalStorage + SessionStorage snapshot
πŸ”€ Navigation Top-level redirect / navigation chain
πŸ“‘ Requests Pixel & analytics calls, classified by vendor
⚠️ Issues Automatic attribution problem detection
πŸ’― Score A simple tracking health score
πŸ“¦ Export One-click local JSON debug report
TrackLens popup preview

πŸš€ Features

πŸ”Ž Attribution parameter inspection

TrackLens parses the active tab URL and highlights the identifiers that matter for attribution:

fbclid gclid ttclid msclkid utm custom

πŸ“‘ Tracking request detection

The background service worker watches outgoing requests and classifies hits to the major platforms:

Vendor Matched endpoints
Meta facebook.com/tr
Google google-analytics.com, googletagmanager.com, doubleclick.net
TikTok analytics.tiktok.com
Microsoft / Bing bat.bing.com
Clarity clarity.ms
Snapchat snapchat.com

⚠️ Automatic issue detection

TrackLens cross-references params, cookies, navigation history and requests to surface the problems that actually break attribution:

  • πŸ”΄ fbclid present in the URL but the _fbc cookie was never set
  • πŸ”΄ Meta pixel is firing but the _fbp cookie is missing
  • 🟠 A click ID or UTM was present earlier in the redirect chain but has been lost on the final page
  • 🟠 The same tracking request appears to be firing multiple times (duplicate pixels)

Each issue costs 15 points off a 100-point Tracking Health score, so you can eyeball a page's status in a second.

πŸ”’ Sensitive value masking

Anything that looks like a secret β€” keys matching token, secret, password, authorization, api_key, session β€” is masked in both the UI and the export (abc***xyz). You can share a debug report without leaking credentials.

πŸ“¦ Local JSON export

One click produces a timestamped tracklens-report-*.json containing the page snapshot, params, cookies, navigation chain, tracking requests, detected issues and score. Perfect for attaching to a bug ticket or sending to an agency.


🧩 How it works

flowchart LR
    classDef page fill:#151d33,stroke:#365cff,color:#e8ecf7,stroke-width:2px
    classDef ext fill:#111827,stroke:#7c5cff,color:#e8ecf7,stroke-width:2px
    classDef store fill:#14251d,stroke:#22c55e,color:#e8ecf7,stroke-width:2px
    classDef ui fill:#1e1b4b,stroke:#22d3ee,color:#e8ecf7,stroke-width:2px

    subgraph Browser["🌐 Chrome tab"]
        P[Web page<br/>URL Β· cookies Β· storage]:::page
        CS[content.js<br/>storage snapshot]:::ext
    end

    subgraph SW["βš™οΈ Service worker"]
        BG[background.js]:::ext
        NAV[webNavigation<br/>redirect chain]:::ext
        REQ[webRequest<br/>tracker requests]:::ext
    end

    ST[(chrome.storage.session<br/>per-tab, wiped on close)]:::store

    subgraph Popup["πŸ” Popup Β· React"]
        UI[Overview Β· Params Β· Cookies<br/>Storage Β· Navigation Β· Requests Β· Issues]:::ui
        AN[Issue engine + health score]:::ui
        EX[JSON export]:::ui
    end

    P --> CS
    P -. navigations .-> NAV
    P -. pixel calls .-> REQ
    NAV --> BG --> ST
    REQ --> BG
    CS -- message --> UI
    ST --> UI
    P -- chrome.cookies --> UI
    UI --> AN --> EX
Loading
Layer File Role
Content script public/content.js Answers a TRACKLENS_SNAPSHOT message with the page URL, title, referrer, LocalStorage and SessionStorage
Service worker public/background.js Records top-level navigations and matching tracker requests per tab into chrome.storage.session, capped at 40 nav events and 120 requests, cleaned up when the tab closes
Popup src/main.tsx React UI that pulls everything together, runs the issue heuristics, computes the score and exports the report
Manifest public/manifest.json Manifest V3, permissions: activeTab, tabs, cookies, storage, webNavigation

πŸ“₯ Installation

Option A β€” Load the ready-made build (no Node required)

  1. Open chrome://extensions
  2. Toggle Developer mode in the top-right corner
  3. Click Load unpacked
  4. Select the dist/ folder from this repository
  5. Pin TrackLens to the toolbar and open any web page πŸŽ‰

Option B β€” Build from source

# install dependencies
npm install

# production build β†’ dist/
npm run build

# or run Vite in dev mode for the popup UI
npm run dev

Then load dist/ as an unpacked extension as described above.


πŸ§ͺ Try the demo

The repo ships with a tiny demo page that sets cookies, writes to storage and fires fake Meta / Google pixel calls so you can see every tab light up.

# from the repository root
python3 -m http.server 8080

Then open:

http://localhost:8080/dist/demo/?fbclid=demo123&utm_source=facebook&utm_campaign=test&ad_id=42

Click the TrackLens icon and you should see recognised parameters, a _fbp cookie, a masked api_token in LocalStorage, and at least one detected issue (the fbclid is there but no _fbc cookie is set).


πŸ›‘οΈ Privacy by design

🏠 Everything stays local. Inspection happens entirely inside Chrome.
🚫 No network calls of its own. TrackLens never phones home, never sends the data it captures anywhere.
πŸ”‘ No accounts, no API keys, no telemetry. Nothing to sign up for, nothing to configure.
🧹 Ephemeral storage. Per-tab data lives in chrome.storage.session and is deleted when the tab closes.
πŸ™ˆ Secrets masked by default. Token-like values are redacted in the UI and in exports.

πŸ› οΈ Tech stack

React TypeScript Vite Chrome Extensions

tracklens/
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ manifest.json      # MV3 manifest
β”‚   β”œβ”€β”€ background.js      # service worker: navigation + request capture
β”‚   β”œβ”€β”€ content.js         # storage snapshot on demand
β”‚   └── demo/index.html    # local test page
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.tsx           # popup UI, issue engine, export
β”‚   └── styles.css         # dark theme
β”œβ”€β”€ dist/                  # ready-to-load build
β”œβ”€β”€ assets/                # README artwork
└── index.html             # popup entry

⚠️ Known limitations

  • Manifest V3 boundaries. MV3 does not expose DevTools-grade request/response introspection. TrackLens focuses on request URLs, browser state, navigation and attribution signals that can be captured locally without a backend.
  • Heuristic issues. The issue detector is intentionally simple and opinionated. Treat it as a fast smoke test, not a compliance audit.
  • Popup-time snapshot. Cookies and storage are read when the popup opens. Hit Refresh after the page changes.

πŸ—ΊοΈ Roadmap

  • Decode common pixel payloads (Meta ev, GA4 en) into readable events
  • Consent-mode awareness (detect CMP state vs. pixel firing)
  • Per-vendor request timelines
  • Configurable custom parameter & endpoint lists
  • Side-panel mode for long debugging sessions
  • Optional light theme

🀝 Contributing

Issues and pull requests are welcome. If you have a real-world attribution bug that TrackLens missed, open an issue with an exported JSON report (secrets are masked automatically) and describe what you expected to see.


πŸ“„ License

Released under the MIT License.


Built for marketers, analysts and developers who are tired of guessing why the numbers don't match.

About

Chrome extension to inspect marketing attribution, tracking parameters, cookies, redirects and pixel requests. 100% client-side, no telemetry.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages