Copy-paste a Liquid snippet for utility - A slim bottom banner that asks for consent once, remembers the choice in the browser, and stays away afterwards.
We use cookies to improve your experience and analyse traffic. Privacy policy
How to install on your store
1Back up your theme (Online Store > Themes > Actions > Duplicate) before changing any code.
2Create snippets/cookie-consent.liquid, paste the code, and render it once in your layout file (e.g. before </body> in theme.liquid).
3Point the policy link at your real privacy policy page.
4NOTE: this stores a preference flag only - if you run ads/analytics, make sure those scripts actually respect the choice.
cookie-consent.liquid
1{%- comment -%}2 Shows once until the visitor accepts or declines. The choice lives in3 localStorage - nothing is sent to a server.4{%- endcomment -%}5<divclass="gpl-cookies" data-gpl-cookies role="region"aria-label="Cookie consent" hidden>6<pclass="gpl-cookies__text">{{text| default: 'We use cookies to improve your experience and analyse traffic.'| escape}}<ahref="/pages/privacy-policy">Privacy policy</a></p>7<divclass="gpl-cookies__actions">8<buttontype="button"class="gpl-cookies__btn gpl-cookies__btn--accept"data-gpl-cookies="accept">Accept</button>9<buttontype="button"class="gpl-cookies__btn gpl-cookies__btn--decline"data-gpl-cookies="decline">Decline</button>10</div>11</div>