Customers using Webflow Optimize on their website can integrate the Enzuzo cookie banner for tracking consent using the JavaScript-configured callbacks described in our Advanced Cookie Banner Configuration documentation.
Ensure Webflow Optimize is enabled for the website. In the "Tracking defaults" section of your Webflow Optimize settings, select "Don't track by default". The cookie banner will manage the tracking preferences signalled by visitors.
βInstall the Enzuzo cookie banner on your Webflow website using one of our installation instructions.
βIn the "Custom Code" tab of your Webflow Settings dashboard, add the following snippet to the section labelled "Head code":
β<script>
window.__enzuzoConfig = {
callbacks: {
init: (consent) => {
wf && wf.ready(() => {
if (!consent.marketing || !consent.analytics || !consent.preferences)
wf.denyUserTracking();
else wf.allowUserTracking();
});
},
acceptAll: (consent) => {
wf && wf.ready(() => {
wf.allowUserTracking();
});
},
decline: (consent) => {
wf && wf.ready(() => {
wf.denyUserTracking();
});
},
acceptSelected: (consent) => {
wf && wf.ready(() => {
if (!consent.marketing || !consent.analytics || !consent.preferences)
wf.denyUserTracking();
else wf.allowUserTracking();
});
}
}
};
</script>Publish your changes.
Note that this code will trigger a "deny tracking" signal in Optimize if the visitor has declined consent in any category; that is, they must accept all cookies in order to allow tracking. If desired, this can be changed by modifying the conditions in the provided if
statements.