Repository navigation
Conversation
Load the Consent Mode defaults and CookieYes first, then start GTM only after Analytics or Advertisement consent and Intercom only after Functional consent, matching patchstack.com. Both listen for CookieYes' cookieyes_banner_load and cookieyes_consent_update events, so consent given later on the same page also loads them, and docs no longer relies on CookieYes' Intercom script-blocking rule. Before consent, #launch-intercom links open the CookieYes preferences instead of calling the missing Intercom, and open chat once the visitor allows it there. Drop the GTM noscript iframe and url_passthrough, which only acted without consent. Co-authored-by: Elliot Taylor <elliot.t@patchstack.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1f036-4d30-7305-867a-24f414b75cc8
|
🎯 Elite quality (92%) — Properly gates GTM and Intercom behind CookieYes consent events, with clear ordering and explanatory comments. 📦 Medium 🤖 Written by Amp — going by its own attribution. Unknown whether a person read it; agents can report that with the 🔴 Risk: Minimal · Low · Elevated · High — returns silently when ✅ Reviewed — approved by @daniloradovic. |
✅ Deploy Preview for deluxe-meerkat-8daf24 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
Author
|
/review |
daniloradovic
approved these changes
Nov 18, 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.
docs.patchstack.com now loads Intercom and Google Tag Manager only after CookieYes consent, the same way patchstack.com does. Before this change, GTM loaded before CookieYes and before any choice. Intercom used the stock snippet, so only CookieYes'
widget.intercom.io/widget|intercom.ioblocking rule kept it from loading before consent. That rule is about to be removed so chat can load on click on the website and Hub, so docs now gates Intercom itself.Order in
<head>(src/components/Head.astro)ads_data_redaction. Previously this was a processed<script>that Astro bundled as a deferred module, so it actually ran after GTM.script.js, loaded synchronously and first, as on the website.GTMScript.astrounchanged. Tags inside container v62 check Consent Mode and trigger oncookie_consent_update.GTM and Intercom both listen for
cookieyes_banner_load(stored consent, every page load) andcookieyes_consent_update(a choice made on this page), so consent given later on the same page also loads them.Chat links: before consent, the
#launch-intercomlinks on FAQ pages open the CookieYes preferences instead of callingIntercom("show"), which would throw. Once the visitor allows Functional there, chat opens.Also removed: the GTM
<noscript>iframe, since a visitor without JavaScript can't consent, andurl_passthrough. The website removed both in its consent PR.Testing
docs.patchstack.comin Chrome, so the real CookieYes banner (activeLaw: gdpr) loaded.directory.cookieyes.com/api/v1/ip→in_eu: true).script.jsserved with thewidget.intercom.io/widget|intercom.iorule stripped from_providersToBlock.Results were the same with and without the rule:
On
main,gtm.jsloads before any choice. With the rule stripped,mainalso loads Intercom before any choice and after Reject All.For the GTM owner: Analytics-only consent sends no GA4 collect hit on
mainor on this branch. Only the gtag.js library loads, and GA4 hits appear only once Advertisement is also granted. This comes from the container or GA4 setup, not from this change.