gdpr-cookie-consent-banner icon indicating copy to clipboard operation
gdpr-cookie-consent-banner copied to clipboard

How to toggle the cookie banner from different button?

Open labbots opened this issue 4 years ago • 2 comments

I would like to open the cookie banner from click of different button other than the button provided by the "ShowEditIcon". I want to display a edit cookie option on the site navigation menu which would open the cookie consent modal. The library function provides only function to attachBanner but there is no other function to trigger the toggle of cookie consent modal. One other thing with the showing edit modal is for the user to update their preference but if the user disables any of the preferences then I dont get any events. So could you provide a event if the user opts-out of any preferences?

labbots avatar Jun 14 '20 01:06 labbots

Hi There,

It would be possible to add a method which allows triggering of the modal. You basically just need to export a function from the main component. I'd happily accept a PR which does this.

As for updating preferences, whilst it would be possible to fire an event when a user unchecks an event, this doesn't make much sense logically - since you'd have to somehow remove tracking from the page after it had been added, or something.

Again I'd happily accept PRs for either of these things, I'm just not sure the second one would do what you want it to do.

antony avatar Jul 28 '20 15:07 antony

btw, I think the second feature was also requested here https://github.com/beyonk-adventures/gdpr-cookie-consent-banner/issues/7

antony avatar Jul 28 '20 15:07 antony

Closing due to inactivity

antony avatar Nov 25 '22 11:11 antony