How to block cookies by using the {cpnb} tags
Some services like the 'Google Tag Manager', 'Google Analytics', the 'Google Adsense', the 'Olark live chat', the 'Zopim live chat', and many other javascript applications, use cookies in their javascript code. This plugin has the excellent opportunity to block the cookies of these scripts by using the <cpnb> tags.
Cases
Case 1. Block any Script
No, any message will be displayed when the user does not consent to cookies.
<cpnb> <script> // The JavaScript (Youtube/Vimeo video iframe, Google Analytics, Google Adsense, Facebook pixel, etc.) code goes here. </script> </cpnb>
Case 2. Block any Script with displaying a message 🆕
<cpnb data-cpnb-no-consent-message="Please, consent to see this video"> <script> // The JavaScript (Youtube/Vimeo video iframe, Google Analytics, Google Adsense, Facebook pixel, etc.) code goes here. </script> </cpnb>
Case 3. Block a Script that belongs to a specific Cookies Category.
With the attribute "data-cpnb-cookie-category-id," you can block the javascript code from specific categories that have already been added in the plugin settings. Note that the category ID should be the same (e.g. analytical-cookies) as has been set in the plugin settings.
<cpnb data-cpnb-cookie-category-id="analytical-cookies"> <script> // The JavaScript (Youtube/Vimeo video iframe, Google Analytics, Google Adsense, Facebook pixel, etc.) code goes here. </script> </cpnb>
Case 4. Block a Script that belongs to a Category and display a message 🆕
With the attribute "data-cpnb-cookie-category-id," you can block the javascript code from specific categories already added in the plugin settings.
Note that the category ID should be the same (e.g. analytical-cookies) as set in the plugin settings.
<cpnb data-cpnb-cookie-category-id="analytical-cookies" data-cpnb-no-consent-message="Please, consent to see this video"> <script> // The JavaScript (Youtube/Vimeo video iframe, Google Analytics, Google Adsense, Facebook pixel, etc.) code goes here. </script> </cpnb>