How to restrict HTML code according to cookie settings


In this guide, you will learn how to modify the HTML codes that you have inserted on your website. This will ensure they either run (or don’t) based on when certain types of cookies are enabled. General setup instructions can be found in the article for the cookies bar

Modifying the code can be useful if you have a widget embedded in the project (via HTML code) that collects cookies. When you insert the modified code, the widget won’t start and will not collect cookies. This procedure also applies to HTML codes that you have inserted in the page header

Example of how the code works: On your website, you have inserted a widget through a modified code that collects functional cookies. A visitor who does not allow the collection of functional cookies will come to your website, so the widget will not be displayed (the code does not run).

The code to be restricted must be defined by one of the following tags:

Marketing cookies: 

{IF_ACCEPTED_MARKETING_COOKIES} 

HTML code 

{/IF_ACCEPTED_MARKETING_COOKIES}

Functional cookies: 

{IF_ACCEPTED_FUNCTIONAL_COOKIES} 

HTML code 

{/IF_ACCEPTED_FUNCTIONAL_COOKIES}
  

Performance cookies: 

{IF_ACCEPTED_PERFORMANCE_COOKIES} 

HTML code 

{/IF_ACCEPTED_PERFORMANCE_COOKIES}

Code example: 

{IF_ACCEPTED_MARKETING_COOKIES}  

<p> This text/widget will appear <b> only </b> if <b> MARKETING COOKIES are accepted </b></p>  

{/IF_ACCEPTED_MARKETING_COOKIES} 



Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.