Switch analytics to Stape server-side GTM#594
Merged
Conversation
Signed-off-by: Dan Barr <6922515+danbarr@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the site's Google Tag Manager integration from client-side GTM (via Docusaurus's built-in preset-classic googleTagManager option) to Stape's server-side GTM service. Analytics requests are now proxied through a first-party subdomain (mm.stacklok.com) rather than loading scripts directly from Google's servers, which is a more privacy-friendly approach.
Changes:
- Replaced the
googleTagManagerpreset option with a custom inline Docusaurus plugin that usesinjectHtmlTagsto inject both the Stape loader script (in<head>) and the GTM<noscript>fallback (in<body>). - Removed the
googleTagManager: { containerId: 'GTM-W9MXGTF9' }configuration from thepreset-classicoptions. - Added a descriptive comment to the HubSpot tracking script entry in the
scriptsarray.
You can also share your feedback on Copilot code review. Take the survey.
Signed-off-by: Dan Barr <6922515+danbarr@users.noreply.github.com>
samuv
approved these changes
Mar 6, 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
Migrates site analytics from client-side Google Tag Manager to Stape's server-side GTM service. Rather than loading scripts directly from Google's servers, analytics requests are proxied through a Stape-hosted endpoint aliased under the
stacklok.comdomain (mm.stacklok.com). Server-side GTM is a more privacy-friendly approach, as it reduces direct data exposure to third-party scripts in the browser.Because the new integration uses an inline loader script rather than an external script URL, the implementation moves from the
scriptsconfig array (which only supportssrcURLs) to a Docusaurus inline plugin usinginjectHtmlTags. This also allows the required GTM<noscript>fallback tag to be injected correctly into<body>.Type of change
Signed-off-by: Dan Barr 6922515+danbarr@users.noreply.github.com