How to Integrate Captain Compliance with Shopify
This article provides an overview of how Captain Compliance integrates with Shopify's native consent framework. It is intended to explain how consent signals are passed to Shopify, how to verify the integration is working, and when a Shopify-native approach is (or is not) the right mechanism for gating tracking technologies on your store.
This article assumes the Captain Compliance consent banner has already been published on your Shopify storefront. If you have not yet deployed the banner, see How to Publish a Consent Banner on Your Website.
In this article
Prerequisite: Disable the Native Shopify Cookie Banner
How Captain Compliance Writes Consent to Shopify
How to Verify the Integration
Using Shopify Consent Signals to Gate Shopify Apps
Limitations Compared to GTM-Based Gating
Choosing Between Shopify-Native Gating and GTM
Prerequisite: Disable the Native Shopify Cookie Banner
Shopify includes a built-in cookie banner that can be enabled from the Shopify admin. When using Captain Compliance, the native Shopify banner must be disabled.
Running both banners simultaneously causes two problems:
Duplicate banners. Visitors may be shown two consent banners, creating a confusing and unprofessional user experience.
Conflicting consent signals. Both banners write consent state to the Shopify Customer Privacy API. If both are active, they can overwrite one another, resulting in inconsistent or incorrect consent enforcement.
To disable the native banner, in your Shopify admin navigate to Settings → Customer privacy and turn off Shopify's built-in cookie banner for the applicable regions. Once disabled, Captain Compliance becomes the sole source of consent presentation and the sole writer of consent state to Shopify.
How Captain Compliance Writes Consent to Shopify
Shopify provides a native consent framework, the Shopify Customer Privacy API, which allows a Consent Management Platform (CMP) to communicate visitor consent state directly to the Shopify platform.
When deployed on a Shopify storefront, Captain Compliance writes the visitor's current consent state to the Shopify Customer Privacy API at two points:
On banner load — When the Captain Compliance banner initializes on a page, the visitor's existing consent state (including any default state determined by your consent model and the visitor's region) is written to Shopify.
After banner interaction — When a visitor interacts with the banner (for example, clicking "Accept," "Reject," or saving granular preferences), the updated consent state is immediately written to Shopify.
This ensures Shopify always holds an up-to-date representation of the visitor's consent decision, both before and after interaction, and on every subsequent page load.
How to Verify the Integration
You can confirm that Captain Compliance is successfully writing consent to Shopify directly from the browser.
Open your Shopify storefront in a browser.
Open the browser's developer console (for example, View → Developer → JavaScript Console in Chrome).
Run the following command:
Shopify.customerPrivacy.currentVisitorConsent();Review the returned object. It reflects the consent state Shopify currently holds for the visitor (for example, marketing, analytics, preferences, and sale-of-data signals).
To validate end-to-end behavior:
Run the command before interacting with the banner and note the default values.
Interact with the banner (accept, reject, or save custom preferences).
Run the command again and confirm the values have updated to match the choice made in the banner.
If the values update in response to banner interaction, the integration is functioning correctly.
Using Shopify Consent Signals to Gate Shopify Apps
The primary benefit of this integration is consent-based gating of Shopify Apps.
Many Shopify Apps — particularly marketing, analytics, and pixel-based apps — are built to respect the Shopify Customer Privacy API. When a visitor has not granted the relevant consent category, these apps suppress or delay their tracking behavior until consent is granted.
Because Captain Compliance keeps the Shopify Customer Privacy API synchronized with the visitor's consent state, consent-aware Shopify Apps are gated automatically, without any per-app configuration.
Note that gating behavior is ultimately determined by each app's implementation. Apps that correctly consume Shopify's consent signals will be gated; apps that ignore the Customer Privacy API will not. If a specific app continues to fire without consent, this typically indicates the app does not honor Shopify's native consent framework, and an alternative enforcement method should be considered.
Limitations Compared to GTM-Based Gating
While Shopify-native gating is convenient, it is less flexible than a Google Tag Manager (GTM)–based implementation.
Key limitations include:
Coarse control. Shopify's consent framework exposes a fixed set of consent purposes. GTM allows tags to be mapped to consent categories with fine-grained triggers, exceptions, and region-specific logic.
App-dependent enforcement. With Shopify-native gating, enforcement depends on each app honoring the Customer Privacy API. With GTM, execution is controlled directly at the tag level, independent of vendor behavior.
Limited timing control. GTM supports advanced patterns such as firing tags immediately upon consent and persisting behavior across subsequent page loads. Shopify's native framework does not offer equivalent control over execution timing.
Script-level use cases. Some tracking technologies and custom scripts are not available as Shopify Apps, or behave differently when installed as one. These specific use cases require firing the scripts from GTM rather than deploying them as Shopify Apps, so that consent enforcement and execution behavior can be controlled precisely.
For a deeper discussion of GTM-based enforcement patterns, see How to Integrate Google Tag Manager (GTM) with Captain Compliance and How to Trigger GTM Tags Immediately After Consent and on Subsequent Page Loads.
Choosing Between Shopify-Native Gating and GTM
The two approaches are not mutually exclusive, and many Shopify merchants use both:
Use Shopify-native gating for consent-aware Shopify Apps that correctly honor the Customer Privacy API. This requires no additional configuration once the Captain Compliance banner is deployed.
Use GTM-based gating for tags and scripts that require precise execution control, region-specific logic, immediate post-consent firing, or that are not suitable for deployment as Shopify Apps.
If you are unsure which enforcement model is appropriate for a particular vendor or script, or if assistance is needed designing your Shopify consent architecture, please contact Captain Compliance for guidance.
