feat(scripts): integrate consent manager with control panel privacy setting#2661
Merged
matthewvolk merged 1 commit intocanaryfrom Oct 31, 2025
Merged
Conversation
🦋 Changeset detectedLatest commit: 500936e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
chanceaclark
approved these changes
Oct 31, 2025
79990a1 to
1b686b4
Compare
jorgemoya
approved these changes
Oct 31, 2025
Contributor
jorgemoya
left a comment
There was a problem hiding this comment.
Maybe a dumb question, but when consent manager is disabled, what is the default consent for scripts? Do they all run or are they all disabled?
|
|
||
| interface ConsentManagerProps extends PropsWithChildren { | ||
| scripts: C15tScripts; | ||
| isCookieConsentEnabled: boolean; |
Contributor
There was a problem hiding this comment.
Biggest 🍹 ever, but what if we rename to isEnabled instead?
1b686b4 to
818e7eb
Compare
818e7eb to
500936e
Compare
jamesqquick
pushed a commit
that referenced
this pull request
Feb 11, 2026
chanceaclark
pushed a commit
that referenced
this pull request
Apr 27, 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.
Note
This PR replaces #2658
Closes #2658
What/Why?
This PR integrates Catalyst's consent manager with the BigCommerce Control Panel's Cookie Consent setting (
Channels > Channel > Customers' privacy > Turn on cookie consent banner for my store), allowing merchants to centrally control whether the consent banner is shown to storefront visitors. The implementation queries thesite.settings.privacy.cookieConsentEnabledfield from the Store Settings API and threads it through the consent manager component hierarchy. When a merchant disables cookie consent in the Control Panel, the consent banner is suppressed and theshowConsentBannerendpoint handler returns a response withshowConsentBanner: falseandjurisdiction: { code: 'NONE' }which has the effect of auto-granting consents inside the c15t library.Testing
Demo:
cookie-consent-enabled-cp-setting.mov
Migration
This PR modifies the following files that you may encounter merge conflicts with:
core/app/[locale]/layout.tsx:privacy.cookieConsentEnabledfield toRootLayoutMetadataQuery(lines 34-36)isCookieConsentEnabledconstant derived from query result (lines 130-131)ConsentManagercomponent to acceptisCookieConsentEnabledprop (line 137)privacy { cookieConsentEnabled }field to your metadata query, extract it from the result, and pass it to<ConsentManager isCookieConsentEnabled={isCookieConsentEnabled} ... />core/components/consent-manager/index.tsx:isCookieConsentEnabled: booleantoConsentManagerPropsinterfaceConsentManagerProviderC15tScriptstype is now imported fromconsent-providers.tsxcore/components/consent-manager/consent-providers.tsx:C15tScriptstype (line 9)isCookieConsentEnabledprop to interfaceshowConsentBannerendpoint handler to be a closure that passes the setting:showConsentBanner: () => showConsentBanner(isCookieConsentEnabled)core/lib/consent-manager/handlers.ts:showConsentBannernow acceptsisCookieConsentEnabled: booleanparametershowConsentBanner: falsewhen consent is disabled in CPIf you've customized your consent manager implementation, ensure that:
cookieConsentEnabledfield is queried from BigCommerce API