Conversion Measurement Without the Double Count: Leads, Purchases and Refunds
A thank-you page reload is not another sale. Define business outcomes, assign stable event identities and reconcile measurement with real orders before optimising spend.

The easiest way to improve reported conversion rate is to count the same conversion twice. Fire a purchase event on the thank-you page, fire another from the payment webhook, then celebrate when the dashboard gets greener. Revenue has not changed. The spreadsheet is lying more enthusiastically.
Conversion measurement should reflect a business state change. A completed order is not a button click. A submitted form is not automatically a qualified lead. Start with that distinction before installing another tag.
Write the outcome contract
For a purchase, decide whether the event means payment authorised, payment captured or order accepted. For a lead, define which submission is accepted and how duplicates or spam are treated. Use the same meaning across your advertising and analytics destinations.
Keep diagnostic events separate. checkout_started, payment_attempted and form_validation_failed help explain a funnel but should not silently become primary conversions. Optimisation platforms will happily pursue the easiest event you tell them to pursue.
| Event | Authority | Stable identity | |---|---|---| | Accepted lead | Server-side accepted submission | Lead receipt ID | | Paid order | Verified payment/order state | Order ID | | Refund | Finance/order record | Refund ID plus order ID |
Do not put a customer's email address in the event ID. A random opaque identifier is enough to recognise the outcome without copying private data into every reporting system.
Choose the authoritative source
A browser can close before the success page loads, reload the page, or block analytics. A verified payment webhook or server-side order transition is usually a stronger source for paid-order truth. That does not make server-side collection exempt from consent or applicable privacy rules.
Verify webhook signatures, handle retries, and store the event before acknowledging delivery. Never trust a query parameter saying paid=true. Your own order system must decide whether the payment was actually accepted.
The following schema illustrates an outbox in an application-owned database. It is a design example, not a complete payment integration.
CREATE TABLE conversion_outbox (
destination text NOT NULL,
event_type text NOT NULL,
event_id text NOT NULL,
occurred_at timestamptz NOT NULL,
payload jsonb NOT NULL,
sent_at timestamptz,
PRIMARY KEY (destination, event_type, event_id)
);Insert the outbox record in the same transaction that records the business transition. A worker sends unsent records and marks successful deliveries. The database constraint prevents your application from enqueueing the same destination event repeatedly.
Retries are normal
A network timeout does not tell you whether the receiver accepted an event. Retrying without a stable identity can create duplicates; refusing to retry loses conversions. Send the same event ID on every attempt and use the destination's documented deduplication mechanism where available.
If you intentionally send both browser and server versions, understand that platform's requirements for matching them. Some require the same event name and ID within a defined time window. A shared order reference in an unrelated custom field may not be sufficient.
Marking an outbox row sent only after success still leaves a crash window after remote acceptance. Deduplication at the receiver is what makes that retry safe. Without it, exactly-once delivery across two systems is not something a local boolean can promise.
Define money carefully
Specify whether value includes tax, shipping and discounts, and use the destination's documented currency format. Do not mix gross order revenue in one system with net paid revenue in another and then blame tracking for the difference.
Keep integer minor units in your operational money model when appropriate, converting explicitly for reporting. Currency exponent rules vary; not every currency uses two decimal places. Avoid a universal divide-by-100 helper if you sell across currencies.
If an order is partly refunded, record the actual refunded amount and tie it to the original order. Use the reporting platform's supported adjustment or refund workflow rather than firing a second negative purchase and hoping the interface understands it.
Reconcile before optimising
For each complete day, compare accepted orders in the operational system with distinct purchase IDs in your measurement export. Separate delayed payment methods, refunds and events still awaiting retry.
Review three lists: operational orders missing from measurement, measurement IDs with no matching order, and repeated IDs. You can investigate a small sample manually before building a full data pipeline. Time zones and attribution dates must match or the comparison will look broken around midnight.
Expected gaps include declined consent, blocked browser collection and different attribution windows. Unexpected gaps include a webhook handler failing after a deployment or a tag firing on every page refresh. Do not hide both under a single "tracking discrepancy" label.
Test inconvenient cases
Run a payment failure, a successful payment, a success-page reload, a webhook retry and a refund in the processor's test environment. Confirm that failure is not counted as purchase, that the reload adds no sale, and that the retry preserves the original identity.
Also test a form submitted twice after a slow response. Business deduplication and measurement deduplication are related but separate: preventing two events does not repair two genuinely duplicated lead records.
Write down which dashboard is used for accounting, which is used for acquisition decisions and what each excludes. The goal is not identical numbers everywhere. It is numbers whose differences have an explanation, so budget changes follow real outcomes instead of delivery artefacts.
Paj Digital Labs
The engineering journal of Paj Digital Solutions — hosting, server infrastructure and web engineering, written by the people who run the servers.
Related reading

Lead Quality Reporting: Optimise for Accepted Work, Not Form Volume
A cheap form submission can be an expensive dead end. Connect acquisition to reviewed lead outcomes without exposing personal data or pretending attribution proves causation.

Technical SEO Monitoring: Catch Broken Signals Before the Monthly Report
Search visibility can regress after one template change. Monitor status, indexability, canonical hosts and sitemap eligibility with small concrete checks tied to release ownership.

SEO Migrations: Redirect Maps That Preserve the Reader’s Destination
A redesign can break search traffic without changing the content. Inventory old URLs, map real replacements and test redirects, canonicals and internal links before the launch.