Get Insight
TRACKING

Counting installs, sign-ups and payments from a browser extension without pixels

Client pixels misfire inside extensions. How to count installs, sign-ups and paid conversions with server-to-server events, click IDs and idempotency keys.

Insight Engineering ·
Dark data center with rows of server racks and a single glowing fiber optic cable running along the floor

A browser extension is an awkward thing to measure. The user sees an ad on one site, installs from a store page on another, opens a popup, signs in on a third page and maybe pays later from a wallet or a card. A tracking pixel placed on a landing page sees the first step and almost nothing else. If you run a small SaaS product on top of an extension, the fix is boring and reliable: stop counting in the browser and count on your server.

Why pixels break around extensions

A pixel is a script or an image request that fires in the visitor's browser when a page loads. That works when the conversion happens on a page you control. For an extension the important moments happen elsewhere: the install is confirmed on a store listing you do not own, activation happens inside a popup or a content script running on someone else's page, and the payment may be completed in a separate window.

Even when a pixel does fire, it is exposed to everything that lives in a browser: content blockers, privacy settings, closed tabs and users who simply navigate away before the request finishes. You end up with numbers that are plausible but quietly low, and low in an uneven way, which is worse than low in a uniform way because it distorts which channel looks best.

A server-to-server event does not have these problems. Your backend knows that an account was created or a payment settled, whether or not any browser is still open. The browser's only job becomes carrying one identifier through the journey.

The click ID is the whole trick

Server-side tracking boils down to a simple loop: an ID goes out with the click, and a request comes back from the server when something valuable happens. AffHouse's guide to postback tracking describes it for affiliate programs: the tracker assigns every click an ID, passes it to the offer link, the program stores it, and later sends a postback carrying that ID so the conversion can be credited to the right click, source and campaign without involving the browser. The same pattern fits an extension, only you are the program.

In practice that means the chain from ad to account has to preserve one value. A workable version looks like this:

  • The ad or campaign link points to your own landing page, with the click ID and UTM parameters in the query string.
  • The landing page stores the click ID in a first-party cookie or in local storage and appends it to the link that leads to the store listing.
  • The extension reads its own install context, or the user lands on a welcome page you control after install, and your backend links the click ID to the new anonymous install ID.
  • When the user signs up or pays, your server looks up the stored click ID and sends the event onward.

Two Chrome extension APIs help here. The runtime.onInstalled event reports a reason of install or update, so you can tell a first install from a version bump and count each correctly. And runtime.setUninstallURL lets you open a page of your choosing after removal, up to 1023 characters long and using http or https, which is a decent place to ask why people left and to record the uninstall on your server.

Pick a short list of events

Resist the urge to send everything. Ad platforms and affiliate partners optimise on a handful of signals, and each extra event is another thing to keep consistent. For an extension product, four are usually enough: install, first successful use (activation), account created and paid. For a product that takes payments from a connected wallet, the paid event should fire from your backend when the transaction is confirmed on chain or by your payment processor, not when the user clicks a button.

Give each event a stable name, a timestamp in UTC, the click ID, a transaction or install ID and, for paid events, an amount with an explicit currency or token. The AffHouse guide lists the same ingredients for postback URLs: click ID, event, payout, currency, transaction ID and status. Keeping statuses such as pending, approved and rejected separate from the event itself saves painful reconciliation later.

Idempotency: send once, count once

Servers retry. Queues redeliver. A webhook from your payment provider can arrive twice. If every delivery creates a new conversion, your reports inflate silently. The defence is idempotency: give every event a unique key and make the receiver ignore repeats.

Stripe's API is a good model. A client generates a unique key, commonly a V4 UUID, up to 255 characters, and sends it with the request. Retries with the same key return the saved response instead of repeating the operation, and keys can be pruned after at least 24 hours. Apply the same idea to your own pipeline: use the payment or sign-up ID as the event key, store it with a unique constraint and let the second insert fail quietly.

If you also keep a browser-side signal alongside the server one, deduplicate the pair. Meta's Conversions API, for example, matches the browser event and server event on event name plus event ID, and discards the later one if both reach the same pixel within 48 hours. Whatever platform you send to, generate the event ID once, at the moment of the conversion, and reuse it everywhere.

Test it like you would a payment flow

Most tracking bugs are mundane, and the AffHouse guide gives a good checklist of them. Run through it before you trust a dashboard:

  • Click your own campaign link, install on a clean browser profile and complete a test sign-up. Confirm the click ID arrives at your server unchanged.
  • Trace the redirect chain hop by hop. A click ID dropped by one redirect is the most common cause of conversions that never match.
  • Check parameter names and case. A mismatch between click_id and clickid fails silently.
  • Encode values properly, and serve your endpoint over HTTPS.
  • Replay the same event twice and confirm it is counted once.
  • Map pending and approved statuses explicitly so unconfirmed payments do not look like revenue.
  • Reconcile weekly against the payment provider or the chain. Differences from late approvals, refunds and cut-off times are normal, but unexplained ones are bugs.

Log every outgoing and incoming event with its status code. A 200 from the receiver means it accepted the request, nothing more, so keep the log long enough to answer why a conversion is missing three weeks later.

What to do first

If you have nothing in place, do the smallest useful version this week. Generate a click ID on your landing page, carry it to the store link, persist it on first run, and send two server events: account created and paid. Add idempotency keys on day one, because adding them after the data is dirty is much harder. A team like ours, building Insight, a browser extension that translates web content with AI and takes payments in Solana tokens, still treats these two events as the source of truth before looking at anything else.

Server-side events will not tell you everything, and they do not decide which touchpoint deserves credit. They give you counts you can believe. For a deeper look at tracker setups and the common ways postbacks go wrong, AffHouse is a handy reference to keep open while you build.

Sources

More from the blog