[AMPMKT-10009] feat(analytics): instrument docs with GTM and PostHog - #718
Open
dbarrialitebox wants to merge 12 commits into
Open
dbarrialitebox wants to merge 12 commits into
dbarrialitebox wants to merge 12 commits into
Conversation
dbarrialitebox
marked this pull request as ready for review
September 1, 2026 20:42
buildstuff-2026
requested changes
Sep 15, 2026
| "contextual": { | ||
| "options": [ | ||
| "copy", | ||
| "view" |
Contributor
There was a problem hiding this comment.
src/docs.json is the main configuration file for the docs. Do not edit it manually, edit src/generate-docs.ts instead.
dbarrialitebox
force-pushed
the
AMPMKT-10009_docs-gtm-baseline
branch
from
September 15, 2026 14:11
c3de0e9 to
bfcb2be
Compare
buildstuff-2026
approved these changes
Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Docs is the only surface with no analytics of any kind, and it is not being
redesigned, so it gives a reference line the rebuilt pages cannot.
docs.json— enables GTM containerGTM-KKG4NLZD, and adds?trk=docstothe two navbar hrefs so docs can be attributed as a signup source.
analytics.js(new) — pusheslogin_button_clickedandcta_clickedto thedataLayer, and loads posthog-js. Mintlify includes any
.jsin the contentdirectory on every page.
Sign inLogin Button Clickedlabel·section: navbar·destination_urlStart building nowCTA Clickedlabel·section: navbar·element_type: button·conversion_type: signup·destination_urlTwo decisions worth knowing:
posthog-js — it assumes an instance is already on the page. Both gaps are what
analytics.jsfills.integrations.posthogis not used. It exposes onlyapiKey/apiHost/sessionRecording, so autocapture cannot be turned off.Docs sends two events and nothing else;
before_sendenforces it.capture_pageviewis off, so docs reports no traffic volume. The two events stillcarry
$pathname, so no report in the plan breaks.Open question: consent
The marketing site starts PostHog opted out and waits for
cookieConsent.setConsent(). Docs has no equivalent and this PR adds none. Bothare on
*.withampersand.comand share the cookie, so this is one posture, not two.Needs a call from whoever owns the consent policy before merge.
Screenshot
N/A