Skip to main content

Shopify

This page explains where to paste the snippet in a Shopify store's theme.

The Shopify labels are those of the admin in English. In another language the names change.

Prerequisites​

Before you start, you need:

  • a web space in the Avacy dashboard, with the banner published;
  • the Avacy snippet copied from the dashboard, as described in HTML snippet;
  • a Shopify account with permission to edit the theme code.
Backup copy

Before editing the code, you can duplicate the theme from the three-dots menu on the theme card. The copy stays among the unpublished themes and serves as a backup.

Steps​

  1. In the Shopify admin, open Online Store from the left menu. Shopify shows the theme you use.

    Online Store page of the Shopify admin, with the active theme and the three-dots button

  2. Press Edit theme. In the theme editor, press the button with the three horizontal dots, top right, and choose Edit code.

    Theme menu in Shopify with the Edit code item

  3. In the layout folder, open the theme.liquid file, the theme's base layout that every page goes through. You can also find it by searching for <head> in the code.

  4. Paste the snippet at the top of the <head>, before all other scripts and before {{ content_for_header }}.

    <head>
    <script src='https://acme.avacy-cdn.com/v3/avacy-cmp-web.js?webspace=123e4567-e89b-12d3-a456-426614174000'></script>
    ...
    {{ content_for_header }}
    </head>

    theme.liquid file in the Shopify code editor with the Avacy snippet at the top of the head

  5. Press Save, top right in the code editor.

Check​

Open the store in a private window. The banner appears on the first visit. The full check is in Check that the banner works.

Shopify store with the Avacy banner appearing on the first visit

What happens when you change theme​

The snippet lives in the theme.liquid of the theme you pasted it into. Each theme has its own theme.liquid.

When you publish a new theme, the previous theme is no longer published and the banner disappears, because the new theme does not contain the snippet. Repeat steps 2 to 5 on the new theme.

Common problems​

SymptomLikely causeWhat to do
The banner does not appear after savingThe snippet is in the duplicated theme, not in the published themePaste the snippet in the published theme
The banner does not appear after a theme changeThe new theme does not contain the snippetPaste the snippet in the new theme's theme.liquid
The console shows an [avacy-loader] messageThe snippet is incomplete or the web space code is wrongRead Check that the banner works
Banner and Shopify Customer Privacy API

Shopify offers a Customer Privacy API for consent banners. This page does not use it: Avacy does not currently have an integration with that API. For details, read the Shopify documentation listed in the sources.

Sources​


Last updated: 09/11/2026.