Docs / Decisions
ADR 0036: A sender can report an issue's clicks from its own tracker, as counts that replace what it reported before
- Status: accepted; built
- Date: 2026-11-29
Context
Araldo reads each newsletter delivery's results from its provider (ADR 0024 decision 15). A provider counts a click only when its own redirect carries it, and most leave that off until the sending domain gets a tracking subdomain. Some senders already send every link through a click tracker of their own (the product's own redirect, recording the campaign each link names), so the clicks exist, just not anywhere Araldo reads. Turning on the provider's tracking as well would put a second redirect in front of theirs to count the same clicks again.
A sender reporting on a schedule needs to be able to send the same counts twice, to correct counts it sent earlier (bots filtered out, a late batch added) and to have reports that arrive out of order not undo newer ones.
Decision
POST /v1/newsletters/{id}/reported_resultstakes one source's counts for an issue:source(a name the sender chooses, 1 to 40 lowercase letters, digits, hyphens or underscores),clicks, optionalunique_clicks(at mostclicks) andas_of, when the source counted. It needsnewsletters:writeand an issue that has gone out (sending, sent or partially sent).- A report is the source's current totals and replaces its last one,
so reconciling is sending the totals again. The same counts change
nothing and are not audited; different ones replace them and are
audited (
newsletter.results_reported). A report counted before the stored one (as_ofearlier) is refused,409 results_stale, so a late report never undoes a newer one.as_ofmay run at most 5 minutes ahead of Araldo's clock. - Counts only. The request takes those four fields and refuses any
other (
parameter_unknown), so no recipient, address, link or visitor can be sent. This keeps Araldo's rule of no audience data. - Kept apart from the providers' results. An issue's
reported_resultslists each source; itsresultsand each delivery's stay as the providers report them. An issue takes at most 5 sources (409 too_many_sources), andDELETE …/reported_results/{source}removes one. - Where a sender reported, its clicks are the issue's clicks: in the dashboard's results and issue page, the overview's last 7 days and brand reports, the sum of its sources' clicks takes the place of the providers'. A sender that reports does so because the provider could not see its clicks, so adding the two would count the same click twice. Delivered emails, opens and unsubscribes still come from the providers.
Alternatives considered
- Importing clicks into the provider. No provider takes clicks counted elsewhere; their counts come only from their own redirect.
- Turning on the provider's click tracking. Needs DNS per sending domain and wraps every link in a second redirect, to count clicks the sender already counts.
- Increments ("3 more clicks"). A retried or duplicated report would
count twice; totals with
as_ofare safe to send again. - Per-day or per-link breakdowns. More to validate and store, and a link label could carry personal data; the totals are what the dashboard and reports use. A later change can add them as counts.
- Reading the sender's tracker as an adapter, as web analytics are (ADR 0025). Every tracker is different, and a sender with its own already has the counts in hand.
Consequences
- A new table,
newsletter_reported_results, one row per issue and source. - Clicks in the dashboard and reports can come from either side; the issue page says which, and the API keeps both.
- A sender's link tracker is trusted with the clicks Araldo shows: Araldo checks the shape of the counts, not whether they are right.