SmartConsent install guide

Install SmartConsent on Hostinger

Hostinger Website Builder lets you add code to your site through its Custom code setting.

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 Hostinger

  1. Open your site in Hostinger Website Builder and select More (⋯), then Integrations.
  2. Paste the code into the Custom code field.
  3. Hostinger puts script tags at the end of the page unless they carry data-render-head, so add data-render-head to both <script> tags you pasted: <script data-render-head> and <script data-render-head async src=…>.
  4. Save, then select Update website so the change goes live.

Hostinger's guide to custom 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