Docs / Decisions

ADR 0036: A sender can report an issue's clicks from its own tracker, as counts that replace what it reported before

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

  1. POST /v1/newsletters/{id}/reported_results takes one source's counts for an issue: source (a name the sender chooses, 1 to 40 lowercase letters, digits, hyphens or underscores), clicks, optional unique_clicks (at most clicks) and as_of, when the source counted. It needs newsletters:write and an issue that has gone out (sending, sent or partially sent).
  2. 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_of earlier) is refused, 409 results_stale, so a late report never undoes a newer one. as_of may run at most 5 minutes ahead of Araldo's clock.
  3. 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.
  4. Kept apart from the providers' results. An issue's reported_results lists each source; its results and each delivery's stay as the providers report them. An issue takes at most 5 sources (409 too_many_sources), and DELETE …/reported_results/{source} removes one.
  5. 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

Consequences

Edit this page on GitHub