Web357 logo

Cookies Policy Notification Bar - Frequently Asked Questions


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 great opportunity to block the cookies of these scripts by using the <cpnb> tags.

Usage

Block any script

<cpnb>
<script>// The Javascript code goes here...</script>
</cpnb>

Block scripts from a specific Cookie Category

With the attribute "data-cpnb-cookie-category-id" you can block the javascript code from specific categories which have already 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 code for Analytical cookies (only) goes here...</script>
</cpnb>

Example with the Google Tag Manager

Google asks for you to place the below code in your index.php of your current Joomla! template.

Without the <cpnb> tags should be like this:

Add before the </head>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WEB357012345');</script>
<!-- End Google Tag Manager -->
</head>
Add after the <body>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P6BZQ92"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

With the <cpnb> tags should be like this:

Add before the </head>
<cpnb data-cpnb-cookie-category-id="analytical-cookies">
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WEB357012345');</script>
</cpnb>
</head>
<!-- End Google Tag Manager -->
Add after the <body>
<body>
<cpnb data-cpnb-cookie-category-id="analytical-cookies">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-P6BZQ92"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
</cpnb>

Stay tuned

We are always working on something new and exciting so make sure to subscribe to our newsletter and be the first to know.