From 51a4354615f2fce5aa857a0cdcc92e9d27ca5033 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Sep 2026 16:08:30 -0300 Subject: [PATCH 01/12] feat: AMPMKT-10009 enable the GTM container on the docs site --- src/docs.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/docs.json b/src/docs.json index 1fb179bc..47c02ba2 100644 --- a/src/docs.json +++ b/src/docs.json @@ -14,6 +14,11 @@ "view" ] }, + "integrations": { + "gtm": { + "tagId": "GTM-KKG4NLZD" + } + }, "navigation": { "tabs": [ { From 3a70b0f00bb54aa7c93906c318b963671db2a7b5 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Sep 2026 16:14:07 -0300 Subject: [PATCH 02/12] feat: AMPMKT-10009 load posthog-js on the docs site with autocapture off --- src/posthog.js | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/posthog.js diff --git a/src/posthog.js b/src/posthog.js new file mode 100644 index 00000000..4d1b3330 --- /dev/null +++ b/src/posthog.js @@ -0,0 +1,46 @@ +// PostHog loader for docs.withampersand.com +// +// Mintlify includes any .js file in the content directory on every page, so this +// file needs no import and no reference from docs.json. +// +// Why it exists: the GTM container (GTM-KKG4NLZD) fires the docs events as +// `window.posthog && window.posthog.capture(...)`. The container does NOT load +// posthog-js — it assumes one is already on the page, which is true on the +// marketing site and the dashboard but was not true here. Without this file those +// tags run, the guard fails, and nothing is sent, with no error. +// +// Mintlify's native `integrations.posthog` is deliberately not used: its schema is +// `additionalProperties: false` over apiKey / apiHost / sessionRecording, so +// autocapture cannot be turned off through it. +(function () { + // The same container also runs on the marketing site, which loads its own + // instance. Two posthog-js on one page fight over the cookie and double-count. + if (window.posthog) return; + + var script = document.createElement("script"); + script.src = "https://us-assets.i.posthog.com/static/array.full.js"; + script.async = true; + + script.onload = function () { + window.posthog.init("phc_VkNFJXeWlP2sOu5X6NA3KQPdupWd4Evpuo4MHasTUbX", { + api_host: "https://us.i.posthog.com", + + // Everything automatic is off on purpose. Docs sends exactly two events, + // both fired from GTM: `Login Button Clicked` and `CTA Clicked` on the + // navbar. The project is already near its ingestion ceiling, and docs is + // instrumented for conversion only. + // + // Cost of `capture_pageview: false`: docs reports no traffic volume. The two + // events still carry `$pathname`, so no report in the tracking plan breaks. + autocapture: false, + capture_pageview: false, + capture_pageleave: false, + capture_heatmaps: false, + capture_dead_clicks: false, + disable_session_recording: true, + rageclick: false, + }); + }; + + document.head.appendChild(script); +})(); From 6a966b425ef8227673a493c19fe2e5e85732403a Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Sep 2026 16:18:10 -0300 Subject: [PATCH 03/12] feat: AMPMKT-10009 add trk=docs to the docs navbar CTAs --- src/docs.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/docs.json b/src/docs.json index 47c02ba2..29fe7496 100644 --- a/src/docs.json +++ b/src/docs.json @@ -578,13 +578,13 @@ "links": [ { "label": "Sign in", - "href": "https://dashboard.withampersand.com/sign-in" + "href": "https://dashboard.withampersand.com/sign-in?trk=docs" } ], "primary": { "type": "button", "label": "Start building now", - "href": "https://dashboard.withampersand.com/sign-up" + "href": "https://dashboard.withampersand.com/sign-up?trk=docs" } }, "footer": { From df5fdbd07db12ae1b2a75ed02f5eb601f69e5681 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Sep 2026 16:28:38 -0300 Subject: [PATCH 04/12] feat: AMPMKT-10009 keep local QA clicks out of the prod project --- src/posthog.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/posthog.js b/src/posthog.js index 4d1b3330..af2ad9f6 100644 --- a/src/posthog.js +++ b/src/posthog.js @@ -17,6 +17,13 @@ // instance. Two posthog-js on one page fight over the cookie and double-count. if (window.posthog) return; + // The GTM container is injected in local preview too, so its tags fire there. + // On localhost posthog still loads and the tags still run — so the wiring is + // testable — but capturing starts opted out, and nothing leaves the browser. + // QA clicks must not land in the baseline or burn ingestion quota. + var isLocal = + location.hostname === "localhost" || location.hostname === "127.0.0.1"; + var script = document.createElement("script"); script.src = "https://us-assets.i.posthog.com/static/array.full.js"; script.async = true; @@ -39,6 +46,9 @@ capture_dead_clicks: false, disable_session_recording: true, rageclick: false, + + opt_out_capturing_by_default: isLocal, + debug: isLocal, }); }; From 9e0931984d997f67212bb480560cc933e9e60741 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Sep 2026 16:51:17 -0300 Subject: [PATCH 05/12] feat: AMPMKT-10009 push the navbar conversion events to the dataLayer --- src/analytics.js | 128 +++++++++++++++++++++++++++++++++++++++++++++++ src/posthog.js | 56 --------------------- 2 files changed, 128 insertions(+), 56 deletions(-) create mode 100644 src/analytics.js delete mode 100644 src/posthog.js diff --git a/src/analytics.js b/src/analytics.js new file mode 100644 index 00000000..411168f1 --- /dev/null +++ b/src/analytics.js @@ -0,0 +1,128 @@ +// Docs analytics. +// +// Two responsibilities, in this order: load posthog-js, then push the two navbar +// conversion events to the dataLayer. GTM maps those pushes to PostHog events — +// nothing here calls `posthog.capture` directly. +// +// Mintlify includes any .js file in the content directory on every page, so this +// file needs no import and no reference from docs.json. + +// --------------------------------------------------------------------------- +// 1. Load posthog-js +// +// Mintlify's native `integrations.posthog` is deliberately NOT used. Its schema is +// `additionalProperties: false` over apiKey / apiHost / sessionRecording, so +// autocapture cannot be turned off through it. Docs is meant to send two events +// and nothing else: the PostHog project is already near its ingestion ceiling, and +// docs is instrumented for conversion only. Loading posthog-js here is what makes +// every capture setting reachable. +// +// It also guarantees `window.posthog` exists. The container's tags are written as +// `window.posthog && window.posthog.capture(...)` — a bundle that does not expose +// the global leaves them no-oping in silence, which is the failure the dashboard +// already hit. +(function () { + // The same container also runs on the marketing site, which loads its own + // instance. Two posthog-js on one page fight over the cookie and double-count. + if (window.posthog) return; + + // The GTM container is injected in local preview too, so its tags fire there. + // On localhost posthog still loads and the tags still run — so the wiring is + // testable — but capturing starts opted out, and nothing leaves the browser. + // QA clicks must not land in the baseline or burn ingestion quota. + var isLocal = + location.hostname === "localhost" || location.hostname === "127.0.0.1"; + + var script = document.createElement("script"); + script.src = "https://us-assets.i.posthog.com/static/array.full.js"; + script.async = true; + + script.onload = function () { + window.posthog.init("phc_VkNFJXeWlP2sOu5X6NA3KQPdupWd4Evpuo4MHasTUbX", { + api_host: "https://us.i.posthog.com", + + // Everything automatic is off on purpose. + // + // Cost of `capture_pageview: false`: docs reports no traffic volume. The two + // events still carry `$pathname`, so no report in the tracking plan breaks. + autocapture: false, + capture_pageview: false, + capture_pageleave: false, + capture_heatmaps: false, + capture_dead_clicks: false, + disable_session_recording: true, + rageclick: false, + + opt_out_capturing_by_default: isLocal, + debug: isLocal, + }); + }; + + document.head.appendChild(script); +})(); + +// --------------------------------------------------------------------------- +// 2. Push the navbar conversion events +// +// The tags in container GTM-KKG4NLZD fire on the custom events `cta_clicked` and +// `login_button_clicked`, and read every property from the dataLayer (GTM `__v` +// variables), not from the DOM. The marketing site pushes them from its own code. +// Docs pushed nothing, which is why no docs event ever reached PostHog. +// +// Labels are declared here, never read from the page text. Reading them from the +// DOM splits the metric in silence the first time the copy changes. +(function () { + var EVENTS = [ + { + path: "/sign-in", + event: "login_button_clicked", + properties: { + label: "Sign in", + section: "navbar", + destination_url: "https://dashboard.withampersand.com/sign-in?trk=docs", + }, + }, + { + path: "/sign-up", + event: "cta_clicked", + properties: { + label: "Start building now", + section: "navbar", + element_type: "button", + conversion_type: "signup", + destination_url: "https://dashboard.withampersand.com/sign-up?trk=docs", + }, + }, + ]; + + // Delegated, because docs is a SPA: the navbar is re-rendered on client-side + // navigation and a listener bound to the node itself would be lost. + document.addEventListener( + "click", + function (event) { + var target = event.target; + if (!target || !target.closest) return; + + var link = target.closest('a[href*="dashboard.withampersand.com"]'); + if (!link) return; + + // Scope by where the element is, not by where it points. Any doc page is + // free to link to the dashboard in its body; only the navbar is a CTA. + if (!link.closest("#navbar")) return; + + var href = link.getAttribute("href") || ""; + for (var i = 0; i < EVENTS.length; i++) { + if (href.indexOf(EVENTS[i].path) === -1) continue; + + var payload = { event: EVENTS[i].event }; + var properties = EVENTS[i].properties; + for (var key in properties) payload[key] = properties[key]; + + window.dataLayer = window.dataLayer || []; + window.dataLayer.push(payload); + return; + } + }, + true + ); +})(); diff --git a/src/posthog.js b/src/posthog.js deleted file mode 100644 index af2ad9f6..00000000 --- a/src/posthog.js +++ /dev/null @@ -1,56 +0,0 @@ -// PostHog loader for docs.withampersand.com -// -// Mintlify includes any .js file in the content directory on every page, so this -// file needs no import and no reference from docs.json. -// -// Why it exists: the GTM container (GTM-KKG4NLZD) fires the docs events as -// `window.posthog && window.posthog.capture(...)`. The container does NOT load -// posthog-js — it assumes one is already on the page, which is true on the -// marketing site and the dashboard but was not true here. Without this file those -// tags run, the guard fails, and nothing is sent, with no error. -// -// Mintlify's native `integrations.posthog` is deliberately not used: its schema is -// `additionalProperties: false` over apiKey / apiHost / sessionRecording, so -// autocapture cannot be turned off through it. -(function () { - // The same container also runs on the marketing site, which loads its own - // instance. Two posthog-js on one page fight over the cookie and double-count. - if (window.posthog) return; - - // The GTM container is injected in local preview too, so its tags fire there. - // On localhost posthog still loads and the tags still run — so the wiring is - // testable — but capturing starts opted out, and nothing leaves the browser. - // QA clicks must not land in the baseline or burn ingestion quota. - var isLocal = - location.hostname === "localhost" || location.hostname === "127.0.0.1"; - - var script = document.createElement("script"); - script.src = "https://us-assets.i.posthog.com/static/array.full.js"; - script.async = true; - - script.onload = function () { - window.posthog.init("phc_VkNFJXeWlP2sOu5X6NA3KQPdupWd4Evpuo4MHasTUbX", { - api_host: "https://us.i.posthog.com", - - // Everything automatic is off on purpose. Docs sends exactly two events, - // both fired from GTM: `Login Button Clicked` and `CTA Clicked` on the - // navbar. The project is already near its ingestion ceiling, and docs is - // instrumented for conversion only. - // - // Cost of `capture_pageview: false`: docs reports no traffic volume. The two - // events still carry `$pathname`, so no report in the tracking plan breaks. - autocapture: false, - capture_pageview: false, - capture_pageleave: false, - capture_heatmaps: false, - capture_dead_clicks: false, - disable_session_recording: true, - rageclick: false, - - opt_out_capturing_by_default: isLocal, - debug: isLocal, - }); - }; - - document.head.appendChild(script); -})(); From a6b71c98bbf54ea182536e175c7a4ca406520c71 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Sep 2026 16:54:03 -0300 Subject: [PATCH 06/12] perf: AMPMKT-10009 load array.js instead of array.full.js --- src/analytics.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/analytics.js b/src/analytics.js index 411168f1..6b1e7ef3 100644 --- a/src/analytics.js +++ b/src/analytics.js @@ -33,8 +33,14 @@ var isLocal = location.hostname === "localhost" || location.hostname === "127.0.0.1"; + // `array.js`, not `array.full.js`: 88KB over the wire instead of 185KB. The full + // bundle inlines session replay, surveys and the other extensions; this one + // fetches them on demand, and with every feature below turned off it never does. + // Same library, same API, same cookie — `posthog-js-lite` is not an option here, + // it persists to localStorage (origin-scoped) and writes a host-only cookie, so + // the cross-subdomain identity join with the site and the dashboard would break. var script = document.createElement("script"); - script.src = "https://us-assets.i.posthog.com/static/array.full.js"; + script.src = "https://us-assets.i.posthog.com/static/array.js"; script.async = true; script.onload = function () { From 75637515db47bd848d16a36ab1ca6ca115fabae9 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Sep 2026 17:09:25 -0300 Subject: [PATCH 07/12] fix: AMPMKT-10009 close the remaining automatic capture paths --- src/analytics.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/analytics.js b/src/analytics.js index 6b1e7ef3..42a0c8a1 100644 --- a/src/analytics.js +++ b/src/analytics.js @@ -22,6 +22,9 @@ // the global leaves them no-oping in silence, which is the failure the dashboard // already hit. (function () { + // The only two events docs is allowed to send. Enforced by `before_send` below. + var ALLOWED_EVENTS = ["CTA Clicked", "Login Button Clicked"]; + // The same container also runs on the marketing site, which loads its own // instance. Two posthog-js on one page fight over the cookie and double-count. if (window.posthog) return; @@ -59,8 +62,28 @@ disable_session_recording: true, rageclick: false, + // These four are NOT off by default and were missed the first time round: + // surveys and feature flags ship enabled, and `capture_performance` has no + // local default at all — it is resolved by the /decide response, so web + // vitals can be switched on from the project settings without this file + // changing. Disabling /decide also stops the `$feature_flag_called` events + // and the request itself. + disable_surveys: true, + capture_exceptions: false, + capture_performance: false, + advanced_disable_decide: true, + opt_out_capturing_by_default: isLocal, debug: isLocal, + + // The lock. Every flag above is a request; this is a guarantee. Anything + // that is not one of the two docs events is dropped before it is sent — + // a new posthog-js version that adds another automatic event, or a remote + // setting flipped in the project, cannot get past it. Returning a falsy + // value aborts the capture outright. + before_send: function (event) { + return event && ALLOWED_EVENTS.indexOf(event.event) !== -1 ? event : null; + }, }); }; From 35318bfa109762329d9aa5c11e53f8a408087eda Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Sep 2026 17:13:12 -0300 Subject: [PATCH 08/12] fix: AMPMKT-10009 keep the allowlist on PostHog event names --- src/analytics.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/analytics.js b/src/analytics.js index 42a0c8a1..0527f10f 100644 --- a/src/analytics.js +++ b/src/analytics.js @@ -23,6 +23,14 @@ // already hit. (function () { // The only two events docs is allowed to send. Enforced by `before_send` below. + // + // These are PostHog event names, NOT the dataLayer ones. Two namespaces: + // dataLayer / GTM trigger : cta_clicked (pushed in part 2, dies in GTM) + // PostHog / capture() : "CTA Clicked" (what before_send sees) + // + // GTM translates between them. Putting the snake_case names here matches nothing, + // so before_send returns null for every event and docs sends absolutely nothing — + // with no error, just a debug log. var ALLOWED_EVENTS = ["CTA Clicked", "Login Button Clicked"]; // The same container also runs on the marketing site, which loads its own From f56897ffed5c732513dcdb8a78129658f921b543 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Sep 2026 17:27:47 -0300 Subject: [PATCH 09/12] refactor: AMPMKT-10009 trim analytics comments to what is not obvious --- src/analytics.js | 100 ++++++++++------------------------------------- 1 file changed, 21 insertions(+), 79 deletions(-) diff --git a/src/analytics.js b/src/analytics.js index 0527f10f..55a0bd58 100644 --- a/src/analytics.js +++ b/src/analytics.js @@ -1,56 +1,18 @@ -// Docs analytics. -// -// Two responsibilities, in this order: load posthog-js, then push the two navbar -// conversion events to the dataLayer. GTM maps those pushes to PostHog events — -// nothing here calls `posthog.capture` directly. -// -// Mintlify includes any .js file in the content directory on every page, so this -// file needs no import and no reference from docs.json. +// Docs analytics. Mintlify includes any .js file in the content directory on +// every page, so this file needs no import. -// --------------------------------------------------------------------------- -// 1. Load posthog-js -// -// Mintlify's native `integrations.posthog` is deliberately NOT used. Its schema is -// `additionalProperties: false` over apiKey / apiHost / sessionRecording, so -// autocapture cannot be turned off through it. Docs is meant to send two events -// and nothing else: the PostHog project is already near its ingestion ceiling, and -// docs is instrumented for conversion only. Loading posthog-js here is what makes -// every capture setting reachable. -// -// It also guarantees `window.posthog` exists. The container's tags are written as -// `window.posthog && window.posthog.capture(...)` — a bundle that does not expose -// the global leaves them no-oping in silence, which is the failure the dashboard -// already hit. (function () { - // The only two events docs is allowed to send. Enforced by `before_send` below. - // - // These are PostHog event names, NOT the dataLayer ones. Two namespaces: - // dataLayer / GTM trigger : cta_clicked (pushed in part 2, dies in GTM) - // PostHog / capture() : "CTA Clicked" (what before_send sees) - // - // GTM translates between them. Putting the snake_case names here matches nothing, - // so before_send returns null for every event and docs sends absolutely nothing — - // with no error, just a debug log. + // PostHog event names, not the dataLayer ones below. GTM translates between them. var ALLOWED_EVENTS = ["CTA Clicked", "Login Button Clicked"]; - // The same container also runs on the marketing site, which loads its own - // instance. Two posthog-js on one page fight over the cookie and double-count. + // The marketing site loads its own instance; two on a page double-count. if (window.posthog) return; - // The GTM container is injected in local preview too, so its tags fire there. - // On localhost posthog still loads and the tags still run — so the wiring is - // testable — but capturing starts opted out, and nothing leaves the browser. - // QA clicks must not land in the baseline or burn ingestion quota. var isLocal = location.hostname === "localhost" || location.hostname === "127.0.0.1"; - // `array.js`, not `array.full.js`: 88KB over the wire instead of 185KB. The full - // bundle inlines session replay, surveys and the other extensions; this one - // fetches them on demand, and with every feature below turned off it never does. - // Same library, same API, same cookie — `posthog-js-lite` is not an option here, - // it persists to localStorage (origin-scoped) and writes a host-only cookie, so - // the cross-subdomain identity join with the site and the dashboard would break. var script = document.createElement("script"); + // array.js, not array.full.js: 88KB over the wire instead of 185KB. script.src = "https://us-assets.i.posthog.com/static/array.js"; script.async = true; @@ -58,37 +20,28 @@ window.posthog.init("phc_VkNFJXeWlP2sOu5X6NA3KQPdupWd4Evpuo4MHasTUbX", { api_host: "https://us.i.posthog.com", - // Everything automatic is off on purpose. - // - // Cost of `capture_pageview: false`: docs reports no traffic volume. The two - // events still carry `$pathname`, so no report in the tracking plan breaks. + // Docs sends two events and nothing else. Mintlify's native + // integrations.posthog cannot express this: it exposes only apiKey, + // apiHost and sessionRecording. autocapture: false, capture_pageview: false, capture_pageleave: false, capture_heatmaps: false, capture_dead_clicks: false, - disable_session_recording: true, - rageclick: false, - - // These four are NOT off by default and were missed the first time round: - // surveys and feature flags ship enabled, and `capture_performance` has no - // local default at all — it is resolved by the /decide response, so web - // vitals can be switched on from the project settings without this file - // changing. Disabling /decide also stops the `$feature_flag_called` events - // and the request itself. - disable_surveys: true, capture_exceptions: false, capture_performance: false, + disable_session_recording: true, + disable_surveys: true, + rageclick: false, advanced_disable_decide: true, + // GTM is injected into local preview too, so its tags fire there. Keep QA + // clicks out of the baseline. opt_out_capturing_by_default: isLocal, debug: isLocal, - // The lock. Every flag above is a request; this is a guarantee. Anything - // that is not one of the two docs events is dropped before it is sent — - // a new posthog-js version that adds another automatic event, or a remote - // setting flipped in the project, cannot get past it. Returning a falsy - // value aborts the capture outright. + // Backstop. A posthog-js upgrade or a remote setting can change any flag + // above; this holds regardless. before_send: function (event) { return event && ALLOWED_EVENTS.indexOf(event.event) !== -1 ? event : null; }, @@ -98,16 +51,9 @@ document.head.appendChild(script); })(); -// --------------------------------------------------------------------------- -// 2. Push the navbar conversion events -// -// The tags in container GTM-KKG4NLZD fire on the custom events `cta_clicked` and -// `login_button_clicked`, and read every property from the dataLayer (GTM `__v` -// variables), not from the DOM. The marketing site pushes them from its own code. -// Docs pushed nothing, which is why no docs event ever reached PostHog. -// -// Labels are declared here, never read from the page text. Reading them from the -// DOM splits the metric in silence the first time the copy changes. +// The GTM tags fire on these dataLayer events and read every property from the +// dataLayer, not the DOM. Labels are declared here, never read from the page: +// reading them splits the metric the first time the copy changes. (function () { var EVENTS = [ { @@ -132,20 +78,16 @@ }, ]; - // Delegated, because docs is a SPA: the navbar is re-rendered on client-side - // navigation and a listener bound to the node itself would be lost. + // Delegated: docs is a SPA and the navbar is re-rendered on navigation. document.addEventListener( "click", function (event) { var target = event.target; if (!target || !target.closest) return; + // Scoped by position, not by destination: page bodies link out too. var link = target.closest('a[href*="dashboard.withampersand.com"]'); - if (!link) return; - - // Scope by where the element is, not by where it points. Any doc page is - // free to link to the dashboard in its body; only the navbar is a CTA. - if (!link.closest("#navbar")) return; + if (!link || !link.closest("#navbar")) return; var href = link.getAttribute("href") || ""; for (var i = 0; i < EVENTS.length; i++) { From 633275a95a1e0b3e291ea4f9bec563636224b4b5 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 1 Sep 2026 17:40:05 -0300 Subject: [PATCH 10/12] refactor: AMPMKT-10009 tighten the delegation comment --- src/analytics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analytics.js b/src/analytics.js index 55a0bd58..03f51afa 100644 --- a/src/analytics.js +++ b/src/analytics.js @@ -78,7 +78,7 @@ }, ]; - // Delegated: docs is a SPA and the navbar is re-rendered on navigation. + // Delegated: the navbar re-renders on client-side navigation. document.addEventListener( "click", function (event) { From 0ae30511fc60d3c3da368fac06fddbcd06832fec Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 15 Sep 2026 11:10:13 -0300 Subject: [PATCH 11/12] revert: AMPMKT-10009 undo manual edits to the generated docs.json --- src/docs.json | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/docs.json b/src/docs.json index 29fe7496..1fb179bc 100644 --- a/src/docs.json +++ b/src/docs.json @@ -14,11 +14,6 @@ "view" ] }, - "integrations": { - "gtm": { - "tagId": "GTM-KKG4NLZD" - } - }, "navigation": { "tabs": [ { @@ -578,13 +573,13 @@ "links": [ { "label": "Sign in", - "href": "https://dashboard.withampersand.com/sign-in?trk=docs" + "href": "https://dashboard.withampersand.com/sign-in" } ], "primary": { "type": "button", "label": "Start building now", - "href": "https://dashboard.withampersand.com/sign-up?trk=docs" + "href": "https://dashboard.withampersand.com/sign-up" } }, "footer": { From bfcb2beb9cd67cc0a94eff9d618a3346f411deab Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 15 Sep 2026 11:11:00 -0300 Subject: [PATCH 12/12] feat: AMPMKT-10009 move the docs.json changes into generate-docs.ts --- src/docs.json | 9 +++++++-- src/generate-docs.ts | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/docs.json b/src/docs.json index 1fb179bc..24985e12 100644 --- a/src/docs.json +++ b/src/docs.json @@ -569,17 +569,22 @@ "./search.json" ] }, + "integrations": { + "gtm": { + "tagId": "GTM-KKG4NLZD" + } + }, "navbar": { "links": [ { "label": "Sign in", - "href": "https://dashboard.withampersand.com/sign-in" + "href": "https://dashboard.withampersand.com/sign-in?trk=docs" } ], "primary": { "type": "button", "label": "Start building now", - "href": "https://dashboard.withampersand.com/sign-up" + "href": "https://dashboard.withampersand.com/sign-up?trk=docs" } }, "footer": { diff --git a/src/generate-docs.ts b/src/generate-docs.ts index c93b2f43..b344a4b4 100644 --- a/src/generate-docs.ts +++ b/src/generate-docs.ts @@ -42,6 +42,11 @@ export interface DocsConfig { api?: { openapi?: Array; }; + integrations?: { + gtm?: { + tagId: string; + }; + }; navbar?: { links?: Array<{ label: string; @@ -133,6 +138,11 @@ export function generateDocsConfig(mintConfig: any): DocsConfig { api: { openapi: ['./platform.json', './read.json', './write.json', './search.json'] }, + integrations: { + gtm: { + tagId: 'GTM-KKG4NLZD' + } + }, navbar: { links: mintConfig.topbarLinks?.map((link: any) => ({ label: link.name, @@ -177,12 +187,12 @@ const baseConfig = { }, topbarCtaButton: { name: "Start building now", - url: "https://dashboard.withampersand.com/sign-up", + url: "https://dashboard.withampersand.com/sign-up?trk=docs", }, topbarLinks: [ { name: "Sign in", - url: "https://dashboard.withampersand.com/sign-in", + url: "https://dashboard.withampersand.com/sign-in?trk=docs", }, ], redirects: [