Accept or Reject cookies with custom link on the page

Accept or Reject cookies with custom link on the page

Written by NelsonLast update 6 months ago

You can allow visitors to change their minds (withdraw Cookie Policy consent if necessary) on any page. This can be done with a checkbox.

To make a custom link that opens Cookie Banner to adjust cookie preferences, see how to display Cookie Banner with a custom link.

Adding checkbox

All you need to do is place a checkbox with an ID csconsentcheckbox in any place of your website, for example on the Privacy Policy page after the Cookie Policy section.

Here is an example of code:

<input id="csconsentcheckbox" type="checkbox">I agree with Cookie Policy

Another example with label text being clickable:

<input id="csconsentcheckbox" type="checkbox"><label for="csconsentcheckbox">I agree with Cookie Policy</label>

You are free to change text and style it as you want. Just make sure it's a checkbox and it has a proper ID attribute.

Checking/Unchecking this box is the same as clicking I agree / I disagree button. If the user already agreed to Cookie Policy, this checkbox will be automatically checked. In fact, if you click I agree / I disagree buttons on the same page, the checkbox will automatically check/uncheck. If the visitor didn't make a choice yet, the checkbox will be unchecked.

You can test if this works properly by clicking this checkbox while the cookie policy popup is visible: it should disappear like when clicking I agree on button

Update: In case you are using cookie categories, the checkbox will act as "I agree to all cookies", meaning checking it will make visitors agree to all cookie categories.

Did this answer your question?