tag" and publish.
onConsentChange
hook to detect consent changes and disable tracking accordingly.To add a cookie consent modal in Webflow using the Insite tool and configure the callback hook for opt-outs, follow these steps:
Insite provides a JavaScript callback hook called onConsentChange()
to monitor and react to a user’s consent changes.
Return to Project Settings → Custom Code → Before tag, and below the Insite script, add a small script to handle the callback. For example:
Enable/disable cookies based on consent by checking categories the user has approved.
Example (can't use raw code block):
Use Insite's global object like:
insite.onConsentChange(function (consent) { if (!consent.analytics) { /_ disable tracking _/ } });
Replace /* disable tracking */
with the app-specific code to disable triggered analytics (like turning off Google Analytics or similar scripts).
onConsentChange
function to prevent those scripts from running unless consent is given.To implement a cookie modal in Webflow using Insite:
onConsentChange
hook to monitor and act on user preferences.This setup ensures compliance while offering users the ability to manage their tracking preferences dynamically.