From 36a46603a034156d15f9d4b6d4e5239fe2317d69 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Tue, 22 Jul 2025 16:45:15 +0200 Subject: [PATCH 1/4] Analytics: send `?status` to the backend Required by https://github.com/readthedocs/readthedocs.org/issues/12307 --- src/analytics.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/analytics.js b/src/analytics.js index 527e9cd8..72e00517 100644 --- a/src/analytics.js +++ b/src/analytics.js @@ -3,7 +3,7 @@ import { default as fetch } from "unfetch"; import { ajv } from "./data-validation"; -import { AddonBase, CLIENT_VERSION } from "./utils"; +import { AddonBase, getMetadataValue, CLIENT_VERSION } from "./utils"; export const API_ENDPOINT = "/_/api/v2/analytics/"; @@ -36,10 +36,12 @@ export class AnalyticsAddon extends AddonBase { } registerPageView() { + const httpStatus = getMetadataValue("readthedocs-http-status"); const params = { project: this.config.projects.current.slug, version: this.config.versions.current.slug, absolute_uri: window.location.href, + status: httpStatus, }; const url = API_ENDPOINT + "?" + new URLSearchParams(params).toString(); From 08e8616a289aab9d4fb414d13764b66d1d7d0e87 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Tue, 22 Jul 2025 16:52:55 +0200 Subject: [PATCH 2/4] Update tests --- tests/analytics.test.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/analytics.test.html b/tests/analytics.test.html index a996214e..40411c9d 100644 --- a/tests/analytics.test.html +++ b/tests/analytics.test.html @@ -1,5 +1,8 @@ - + + + +