Today we would like to share with you a super simple guide for adding cookies to your webflow websites. This will allow you to very easily hide modals, pop-ups etc and for them to NOT show again. (for a selected amount of days)
Using cookies for your pop-ups & notices can be a super powerful way to display information once, without constant bombardment to your visitors.
Firstly, copy the following script into the section of your custom-code settings.
Please Note: The custom-code section can be found in your page settings or project settings. If your cookie applies sitewide be sure to include this in the project settings.
Copy these attributes into the aftersection of your custom-code settings.
Add the #ID (cookieBlock)
Navigate to the primary layer of your cookie element. This could be the primary wrapper for your pop-up / notice / modal etc. We need to give the ID 'cookieBlock' to this element.
Navigate to the accept / close button of your cookie element. Once a user clicks this button / link etc, it will close the cookie and store this. We need to give the ID 'accept' to this element.
Learn how to add smooth scrolling to your webflow site, for a modern intertia type effect.
How to make your webflow site multilingual - quickly and without a single line of code.