I would like to set a Cookie after a user clicks on a button or a specific link. In plain JavaScript, it would be something like this:
document.cookie = “key=value”;
In the Corvid API, the closest thing I found was wix-storage, but this does not seem to set cookies. I also tried to embed the JavaScript code within an HTML-Code-Block, but this does not set a cookie for my actual site.
I would appreciate it very much if anyone could give me a hint how to set a simple cookie with Corvid!
I’m not sure, but I guess you can add a snippet to the Analytics&Tracking on your dashboard to set a cookie onMessage(). https://www.w3schools.com/js/js_cookies.asp
Then on your site page add an html component and put there the postMessage that will trigger the cookie setting.
I don’t know. I’ve never done it. What I said earlier was off the top of my head. I don’t know if it works and how exactly to deactivate Google Analytics.
Hi, I think I managed to create a GDPR-compliant Opt-In in Wix. I first tried with postMessage, but I didn’t get this to work. The Idea of the solution that works is to use local Wix storage (which saves a text file in your browser in the format key-value pair) and on html site code to block the Google Analytics until you read this “cookie” out of local storage. Once you find the “allowgoogleanalyticscookie”, then Google Analytics will start.
I will either create a youtube-video of this solution or post some advice here, maybe in a few days…