Install PrivacyQuick on Shopify
Tell Shopify you're using your own banner, paste one tag into theme.liquid, add a short bridge so Shopify's own pixels follow the visitor's choice, and test.
Shopify has its own consent system, the Customer Privacy API. Shopify's cookies, the pixels you manage under Customer events and checkout all follow the choice stored there. So on Shopify, a banner has two jobs: collect the visitor's choice, and hand it to Shopify. This page shows both. For the wider picture, including Shopify's built-in banner and consent apps, read the full guide to cookie consent on Shopify.
What you need: a PrivacyQuick account (the Free plan is fine) and a Shopify staff account that can edit themes and privacy settings. Shopify's admin menus change from time to time, so the labels below may differ slightly.
1. Add your store and copy the snippet
In the PrivacyQuick dashboard, add your store's public domain, for example shop.example.com (not the myshopify.com address, unless that's the one customers use). Copy your snippet:
<script src="https://cdn.privacyquick.com/v1/privacy.js" data-site-id="pq_xxxxxxxxxx" async></script>
2. Tell Shopify you use your own banner
In the Shopify admin, go to Settings → Customer privacy → Cookie banner. Shopify's help center describes setting up a third-party banner there: remove Shopify's own banner (Remove cookie banner, where available) and set your consent regions (Set custom banner regions). Shopify asks you to use the same consent regions in its settings as in your banner tool. On PrivacyQuick's Free plan every visitor gets the opt-in banner; on Starter and Pro, regional rules work on five groups (EU/EEA/UK/Switzerland, US, Canada, Brazil, rest of the world), so match Shopify's regions to the groups you set to opt-in.
Shopify keeps holding back its own cookies and pixels in those regions until a choice is recorded, which step 4 takes care of. If you skip this step, visitors in some regions may see two banners.
3. Paste the snippet into theme.liquid
- Go to Online Store → Themes and duplicate your live theme as a backup.
- On the live theme, open the … menu and choose Edit code.
- Open
layout/theme.liquid. - Paste the snippet right after the opening
<head>tag, above other scripts, and save.
If your theme has other layout files (search the theme for </head>), add the snippet there too. Checkout pages can't run theme code, which is why the next step matters.
4. Pass the choice to Shopify
Paste this under the snippet in theme.liquid. It listens for PrivacyQuick's pq:consent event, which fires when a visitor makes or changes a choice, and records the matching purposes with Shopify:
<script>
document.addEventListener('pq:consent', function (e) {
var cats = e.detail.categories;
var consent = {
analytics: cats.indexOf('analytics') > -1,
marketing: cats.indexOf('marketing') > -1,
preferences: cats.indexOf('functional') > -1,
sale_of_data: cats.indexOf('marketing') > -1
};
if (!window.Shopify || !window.Shopify.loadFeatures) return;
window.Shopify.loadFeatures(
[{ name: 'consent-tracking-api', version: '0.2' }],
function (error) {
if (error) return;
window.Shopify.customerPrivacy.setTrackingConsent(consent, function () {});
}
);
});
</script>
- Mapping. PrivacyQuick's Analytics and Marketing categories map to Shopify's
analyticsandmarketingpurposes, and Functional maps topreferences.sale_of_datafollows Marketing, so a US visitor who clicks "Do Not Sell or Share" is also opted out of sale in Shopify. - Version. Use the
versionvalue from Shopify's current Customer Privacy API documentation; it changes occasionally. - Returning visitors. Shopify stores the choice in its own cookie, so you only need to send it when it changes, which is exactly when
pq:consentfires.
5. Tag scripts you added to the theme
Rather not tag each script? Put the automatic blocker line directly above the snippet. It holds scripts from known analytics and advertising services, so you only tag what it doesn't cover. It has to load before those scripts, so it only helps if you paste it at the very top of the head in theme.liquid, ahead of your apps' scripts.
Shopify only controls its own pixels and app pixels. Anything you pasted into the theme yourself, such as an analytics snippet, a chat widget or a review widget, runs regardless. Tag those so they wait for consent:
<script type="text/plain" data-category="marketing" src="https://example-ads.com/pixel.js" async></script>
Use analytics, functional or marketing as the category. Iframes use data-src instead of src. Details are in Blocking scripts. Apps installed from the App Store that add code through app embeds are usually controlled by Shopify's consent; check each app's documentation.
6. Test it
- Open the store in a private window. The PrivacyQuick banner appears and Shopify's own banner doesn't.
- Choose Reject all, then run
Shopify.customerPrivacy.currentVisitorConsent()in the browser console. Analytics and marketing should show'no'. - Open the preferences from the floating cookie button, accept everything, and run the command again. They should show
'yes'. - Check the Network tab: theme scripts you tagged load only after you accept.
- In the PrivacyQuick dashboard, the store shows Installed within a minute or two.
Finish the setup
- Run a cookie scan to see what your theme and apps load.
- Link your privacy and cookie policy from the footer. The policy generator can host a cookie policy whose cookie table updates from your scans, and our guide to a Shopify store privacy policy covers what to add to Shopify's own template.
- If you use Google Analytics or Google Ads through the Google & YouTube app, read Google Consent Mode v2.
Stuck? Email [email protected] with your store address.