Finaly a cookie solution
for Webflow
100% personnalisable

Let's go !
First commandment

Make sure they have their consent before stalking your users

With this very simple JavaScript solution, you will wait for the consent of your users
before launching Google Analytics, Google Tag Manager and Hotjar.

Copy this code into your project in: Settings> Custom code> Footer Code. Personalize the name of your cookie and the variables with your GA, GTM, Facebook Pixel ID or Hotjar identifiers and if you do not want one of these trackers, delete the corresponding variable

Copier

<script>
var idCookie="AAAAAAAA-cookie",
GA_ID="UA-0000000-0",
GT_ID="GTM-AAA00AA",
FB_ID="000000000000000",
HJ_ID=000000,

validDays=90,
hideDelay=0,

now=new Date;function getExpirationDate(){var e=new Date(now);return e.setDate(e.getDate()+validDays),e}var expirationDate=getExpirationDate(),domCookie=document.querySelector(".cookie-wrapper"),domCookieAccept=document.querySelector(".cookie-accept"),head=document.getElementsByTagName("head")[0];function loadHotJar(){var e,t,o,a;e=window,t=document,e.hj=e.hj||function(){(e.hj.q=e.hj.q||[]).push(arguments)},e._hjSettings={hjid:HJ_ID,hjsv:6},o=t.getElementsByTagName("head")[0],(a=t.createElement("script")).async=1,a.src="https://static.hotjar.com/c/hotjar-"+e._hjSettings.hjid+".js?sv="+e._hjSettings.hjsv,o.appendChild(a)}function loadFB(){var e=document.createElement("script");e.type="text/javascript",e.textContent="function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js');fbq('init', '"+FB_ID+"');fbq('track', 'PageView');"}function loadGA(){var e=document.createElement("script");e.type="text/javascript",e.src="https://www.googletagmanager.com/gtag/js?id="+GA_ID,head.appendChild(e),(e=document.createElement("script")).type="text/javascript",e.textContent="window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '"+GA_ID+"' );",head.appendChild(e)}function loadGT(){!function(e,t,o,a,n){e[a]=e[a]||[],e[a].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var c=t.getElementsByTagName(o)[0],i=t.createElement(o);i.async=!0,i.src="https://www.googletagmanager.com/gtm.js?id="+n,c.parentNode.insertBefore(i,c)}(window,document,"script","dataLayer",GT_ID)}function cookieAccepted(){domCookie&&setTimeout(function(){domCookie.style.display="none"},hideDelay),void 0!==HJ_ID&&loadHotJar(),void 0!==GA_ID&&loadGA(),void 0!==GT_ID&&loadGT(),void 0!==FB_ID&&loadFB()}function checkCookieAccept(){var e=localStorage.getItem(idCookie),t=new Date(e);e?t-now>0?cookieAccepted():localStorage.removeItem(idCookie):domCookie&&(domCookie.style.display="block")}function acceptCookie(){localStorage.getItem(idCookie)||(localStorage.setItem(idCookie,expirationDate),cookieAccepted())}checkCookieAccept(),domCookieAccept&&domCookieAccept.addEventListener("click",acceptCookie);
</script>

madeAndExplainedByHopwebArmandSallé
Jsinnay
ENFR