SmartConsent install guide

Install SmartConsent on Shopify

Shopify themes take extra code through the theme's main layout file, theme.liquid, which builds the head of every page.

Last updated: 18 November 2026

The code to paste

Replace YOUR_SITE_ID with your own site ID. Don't have one? Scan your site free and get it at the end.

SmartConsent: paste once, site-wide

html
<script>
window.dataLayer = window.dataLayer || [];
window.gtag = window.gtag || function () { window.dataLayer.push(arguments); };
window.gtag('consent', 'default', {
  ad_storage: 'denied',
  ad_user_data: 'denied',
  ad_personalization: 'denied',
  analytics_storage: 'denied',
  functionality_storage: 'denied',
  personalization_storage: 'denied',
  security_storage: 'granted',
  wait_for_update: 500
});
window.smartconsent = window.smartconsent || function () { (window.smartconsent.q = window.smartconsent.q || []).push(arguments); };
</script>
<script async src="https://cdn.smartgenie.co.uk/v1/smartconsent.min.js" data-site-id="YOUR_SITE_ID"></script>

Scan your site free

Add it to Shopify

Shopify lets you edit a paid theme's code only after you've bought it, not on a trial.

  1. From your Shopify admin, go to Online Store, then select … next to your theme and Edit code.
  2. In the layout folder, open theme.liquid.
  3. Paste the code just after the opening <head> tag.
  4. Select Save.

Shopify's guide to editing theme code

Check it works

Open your site in a private browser window. The consent banner should appear. Then run a free scan to see what the site sets before a visitor chooses.

Scan your website for free