Add the TermsFeed Privacy Consent cookie banner to a Shopify store by pasting its snippet into layout/theme.liquid, then pass each answer to Shopify through the Customer Privacy API. Privacy Consent installs as a theme edit, not as a Shopify app. The ePrivacy Directive and the General Data Protection Regulation (GDPR) ask for consent before non-essential cookies load, and the consent banner collects that answer.

Setup takes 6 steps and about 20 minutes. You need a Shopify staff account with permission to edit themes, and a plan that allows theme code edits. The Shopify Starter plan comes with the Spotlight theme only, and Shopify states that other themes and customization options are not available on it. Keep your snippet ready from "Install link" on the Overview page of the consent banner, or start with Create a Consent Banner.

Paste the snippet into layout/theme.liquid, the layout file that the storefront pages of a Shopify Online Store 2.0 theme share. A snippet in a section or a Custom Liquid block loads only on the templates that use it.

Open the code editor of your current theme from the Shopify admin.

  1. Go to Online Store > Themes.
  2. Click the horizontal menu icon beside your current theme and select Duplicate to keep a backup.
  3. Click the horizontal menu icon of the current theme again and select Edit code.
  4. Open theme.liquid in the Layout folder.
  5. Paste the snippet directly before the closing </head> tag and click Save.

The snippet you paste has this form, with your own token in its address.

<!-- Privacy Consent by TermsFeed (https://www.termsfeed.com) -->
<script type="text/javascript" src="https://cdn.termsfeedtag.com/plugins/pc/v1/YOUR_TOKEN/plugin.js" async></script>
<!-- End Privacy Consent by TermsFeed (https://www.termsfeed.com) -->

A store with a password page uses layout/password.liquid for that page, so paste the snippet there too while the password page is on. Each theme keeps its own theme.liquid, so a newly published theme needs the snippet again.

Remove the Shopify consent banner, so visitors answer one consent banner instead of 2. Shopify shows its own consent banner to visitors in the UK and the European Economic Area (EEA) when your store has active markets there. The Shopify answer and the Privacy Consent answer stay separate until you connect them in Step 3.

Change the setting in Settings > Customer privacy, as the Shopify customer privacy article shows. Shopify notes that not every store offers the "Remove cookie banner" option.

  1. Click "Cookie banner".
  2. Click the horizontal menu icon and select "Remove cookie banner".
  3. Click Remove.
  4. Select the regions with the "Set custom banner regions" button, or with Edit in the Regions section where that button is missing, and click Save.

Select every region where Privacy Consent asks for consent, which under the Strict consent logic means every region. Shopify warns that non-essential data is processed before consent where the 2 lists of regions differ.

Send every answer to the Customer Privacy API, so Shopify pixels, Shopify cookies, and the apps that read the API follow it. Privacy Consent does not send any signal to Shopify by itself, and the consent signals it sends for template vendors go to the vendors, not to Shopify. Load the API, send the choice from the callbacks, and restore it for returning visitors with the Shopify Customer Privacy API page.

Move the tracking pasted into your theme into vendors, and check that everything Shopify runs follows the Customer Privacy API. Privacy Consent controls only its vendor tags and replaceable tags, so each part of a store takes its own decision.

  • Tags pasted into the theme. A Google Analytics 4 or Meta Pixel snippet in theme.liquid runs before the visitor answers. Remove it and add the tool as a vendor.
  • Pixels added in the admin. App pixels and custom pixels in Settings > Customer events run in a Shopify sandbox that Privacy Consent does not reach. Shopify runs them by the consent the Customer Privacy API records.
  • Apps and theme app embeds. Their scripts are not in your theme code. Open Online Store > Themes > Edit theme > App embeds, then check whether each app reads the Customer Privacy API or turn its tracking off.
  • Tools in 2 places. A tool that runs through an app and through a vendor sends each event twice, so keep it in one place.

A vendor template asks only for the IDs of the tool. Add each tool with Add From a Template, or with Add a Custom Vendor and its code in the on-accept vendor tag where it has no template.

Add a footer link that reopens the Preferences Center, so visitors change their answer from any storefront page. Put the link in the footer section file of your theme, in the Sections folder, or in a Custom Liquid block of the footer.

<a href="#" id="open_privacy_preferences_element">Privacy Preferences</a>

Privacy Consent stops the # link from jumping to the top of the page. Compare this link with the floating button in Reopen Preferences.

List your own domain and the your-store.myshopify.com address on the consent banner. Open Settings on the consent banner in the TermsFeed app, select "+ Add domain" under "Additional domains", enter the hostname, and select Add. The app removes www. from each domain you enter, and a listed domain covers its subdomains.

The consent banner still loads on a hostname missing from the list, and the Analytics page does not count those banner loads. Consent stays with each origin, so a visitor who answered on your-store.myshopify.com sees the consent banner again on your own domain. Choose what to list with Multiple Domains.

Save the theme first, then test the live storefront in a new private window, which does not hold an earlier answer or an admin session. A new consent banner uses the Strict consent logic, so it asks every visitor. Under the Standard consent logic, a visit from the US usually does not show a consent banner, so run the test from another location with Test Visitor Location.

Use a tool with an on-accept vendor tag for the check that a vendor waits. A Google tag from its template loads before the answer, by design, and runs in Consent Mode. Test it by the _ga cookie in the Application tab, which appears only after I Agree.

  1. Close every private window, open your store in a new one, open Chrome DevTools, select the Network tab, type termsfeedtag in the filter box, and reload. plugin.js and 2 settings.json requests return status 200, and the consent banner shows.
  2. Select the second settings.json request and open its Preview tab. The serviceable field reads true.
  3. Select the Console tab. No line holds [ee] or [ww].
  4. Type the host of a vendor you moved in the Network filter, such as hotjar.com, and reload. No request appears before you answer.
  5. Click I Agree. Requests to that host appear with no page reload.
  6. Type events.push in the Network filter. The last request, sent at your click, has status 201.
  7. Run Shopify.customerPrivacy.currentVisitorConsent() in the Console tab. The analytics value reads yes.
  8. Click your "Privacy Preferences" link. The Preferences Center opens.

A serviceable value of false stops the script, with [ww][05cfcfb6] in the Console and no consent banner. Check the status with Enable, Disable, Delete.

Test the refusal next. Close every private window, open a new one with the Network tab filtered on the same host, load your store, and click I Decline. Open a second page and confirm that the Network tab does not list any request to that host. Run the remaining checks with Verify Your Installation.

Privacy Consent does not run on Shopify checkout pages, because Shopify applies a theme layout such as theme.liquid only to pages outside the checkout. The consent banner, the vendors, and the Preferences Center stop at the cart, according to the Shopify layouts reference. The Customer Privacy API connection has to run on the storefront before the visitor reaches checkout. Plan conversion tracking around that limit with Unsupported Environments.

How a Hydrogen storefront differs from a Liquid theme

A Hydrogen storefront is a React application with no theme.liquid, so the snippet goes into the document head of its root layout. Add it as a plain <script> element, never through a component that mounts after the page loads. Page changes in Hydrogen do not reload the document, so handle them with Single-Page Applications.

The Customer Privacy API connection in Step 3 targets Liquid themes. A Content Security Policy on the storefront has to allow cdn.termsfeedtag.com. Copy the entries from Content Security Policy.

Start with the Network tab and the theme list, which show a second consent system and a snippet in the wrong theme.

  • The Shopify consent banner still shows. A visitor from the UK or the EEA answers 2 consent banners. Remove it in Settings > Customer privacy.
  • A tag stays in theme.liquid. The tool runs before consent, next to the vendor that runs it after consent. Search the file for the hostname the tool loads from, and remove the tag.
  • The snippet went into a theme that is not published. The page source of the live store does not hold plugin.js. Edit the theme marked current in Online Store > Themes.
  • The Customer Privacy API is not connected. Shopify pixels and apps ignore the answer. The Shopify.customerPrivacy check does not return yes after I Agree.
  • The test looks for the consent banner at checkout. Checkout pages never show it. Test on a product or collection page.