Skip to content

Document tracking API response codes and how plugins reject tracking requests - #993

Open
sgiehl wants to merge 3 commits into
livefrom
tracking-api-responses
Open

sgiehl wants to merge 3 commits into
livefrom
tracking-api-responses

Conversation

@sgiehl

@sgiehl sgiehl commented Nov 23, 2026

Copy link
Copy Markdown
Member

Description

Documents the tracking endpoint's status codes and error handling as changed in matomo-org/matomo#25727 (Matomo 6.1).

Tracking HTTP API reference (docs/6.x/tracking-api.md)

  • New "Responses" section: what each status code means and whether a client should send the request again, that a failed tracking pixel still gets the image, and that a request keeps its success response if something fails after it was recorded. Includes a note on what changed in 6.1 (until 6.0, errors in a plugin were answered with 200 and an Error: body).
  • New "Bulk tracking responses" section: the JSON body (status, tracked, invalid, invalid_indices), when a whole bulk request fails, and that since 6.1 a single request rejected with a 4xx other than 408/429 is counted as invalid.
  • send_image: a failed request is still answered with its error code.
  • "Debugging the Tracker": tracker server errors are only logged in the configured [log] log_writers. With the default screen writer they aren't logged anywhere, so admins need to add file, errorlog or syslog. Since 6.1 there is no extra write to PHP's error log, and the query string is no longer included in log records.

Plugin guide "Tracking Requests" (docs/6.x/tracking-requests.md)

  • New "Rejecting a tracking request" section: throw an HttpCodeException (eg BadRequestException) to answer with its 4xx/5xx code. 4xx is only debug-logged and only that request is counted invalid in a bulk request. Any other exception is a logged 500. Use 408/429 for errors worth retrying.

Should be merged once matomo-org/matomo#25727 is merged, and only be published with Matomo 6.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant