How do I install a Shopify cookie banner?
Add the CookieConsentHQ script to your Shopify theme's layout/theme.liquid file. Place it immediately after the opening <head> tag, before analytics and advertising scripts, and save the changes.
Follow these steps:
- Open your Shopify admin.
- Go to Online Store, Themes.
- Open the three-dot menu and select Edit code.
- Find
layout/theme.liquid. - Locate the opening
<head>tag. - Paste the script immediately after that tag.
- Save your changes.
Copy the snippet from your CookieConsentHQ dashboard's Install tab. It uses this format:
<script src="https://cdn.cookieconsenthq.com/s/YOUR_SITE_KEY.js"></script>
Use your assigned site key instead of YOUR_SITE_KEY. The script must load synchronously, without async or defer.
Shopify's official theme-code documentation explains how theme files are edited and saved. This CookieConsentHQ installation uses that theme-code facility.
It is a script-tag installation, not a Shopify app or native integration. For instructions covering other platforms, see the installation guides.
Should I disable Shopify's existing cookie banner?
Yes, turn off Shopify's own cookie banner after adding CookieConsentHQ so visitors are not presented with two banners. Shopify manages its built-in banner through Settings, Customer privacy.
Open that section and remove or deactivate Shopify's existing cookie banner. Shopify's customer privacy documentation describes its cookie-banner settings and removal controls.
Keeping two independent banner interfaces on the same site can create confusing consent experiences. The visitor should see the banner you intend to use, with its available choices and preferences.
CookieConsentHQ offers Accept all, Reject all and Customize in its opt-in model. The default banner gives Accept and Reject equal visual weight and includes functional, analytics and marketing categories.
Disabling Shopify's displayed banner does not establish that every Shopify-managed tracking feature follows CookieConsentHQ's choices. Review your store's tracking setup separately, including Shopify-managed services.
Does CookieConsentHQ run on Shopify checkout pages?
The script added to theme.liquid runs on Shopify theme pages. Shopify controls checkout pages, so this installation should not be described as providing checkout-wide banner coverage.
That distinction is important when planning where visitors encounter the CookieConsentHQ banner. The theme installation gives you a defined place to load it on the online store's theme pages, while checkout belongs to Shopify's separate environment.
Do not assume that a successful storefront test proves that the same script executes during checkout. The installation method described here does not add the script to Shopify-controlled checkout pages.
CookieConsentHQ's consent records describe choices captured by the banner where it operates. The consent log stores the selected action, timestamp, categories, region and banner configuration version.
Review the boundaries of the theme installation before relying on those records for workflows involving other parts of the store.
Can I block hardcoded trackers in my Shopify theme?
Yes, CookieConsentHQ automatically blocks known trackers before consent and supports additional manual blocking markup. For tracking scripts written directly into your HTML, use type="text/plain" with a data-cchq category when you also need to prevent the browser from fetching the resource early.
For example, a marketing script can use:
<script type="text/plain" data-cchq="marketing" src="..."></script>
The category can also be analytics or functional, depending on the script's purpose.
CookieConsentHQ can stop known scripts written with ordinary <script src> tags from executing, but browsers may fetch those resources before the blocking logic runs. The manual markup addresses that early-request issue.
For embedded content, use an iframe with data-cchq="marketing" and data-cchq-src instead of placing the external URL directly into src.
These controls apply to markup you can edit. They should not be treated as proof that the theme script controls every Shopify-managed or app-managed tracking mechanism.
See the full installation documentation for the supported attributes and examples.
Can I add a cookie declaration table and preferences link?
Yes, you can place the CookieConsentHQ cookie table placeholder in editable theme content. You can also add a link that calls CCHQ.showPreferences() to reopen the visitor's preferences.
The cookie table uses:
<div data-cchq-cookie-table></div>
The cookie scanner categorizes discovered cookies and can supply the declaration table automatically. Scan coverage depends on your plan and the pages visited.
For consent preferences, the JavaScript API also provides CCHQ.getConsent() for reading the current choice. A site can obtain the consent ID using CCHQ.getConsent().id, for example when connecting a privacy request form to the dashboard's record lookup.
These are separate controls: the declaration table presents cookie information, while the preferences interface lets visitors revisit their choices.
How do I check the published Shopify installation?
Publish the theme changes and open a public storefront page to check that the CookieConsentHQ script loads. Then use the free checker to inspect cookies set before consent, hardcoded tracker tags and Consent Mode v2 defaults.
The checker scans one page. It does not inspect every product page, every theme template or Shopify checkout.
For broader coverage, the CookieConsentHQ scanner crawls up to 50 pages on Free or 150 on paid plans. It loads pages before consent and revisits the first few after acceptance.
If the initial page contains hardcoded tracking tags, check their order relative to the CookieConsentHQ loader. Early placement is necessary for the loader to establish its controls before those tags execute.
CookieConsentHQ provides consent-management tools for the supported installation area. The store owner remains responsible for assessing the site's tracking behavior and applicable legal requirements. This page is not legal advice.