×

How to block third-party cookies on your site (with Cookino)

Cookino makes simple and quick to block cookies, but let's draw a distinction: not all cookies should be disabled. Technically, it is the scripts that install the cookies that must be banned, not the cookies themselves. These scripts are codes contained within the <script> element of a web page that are used to add functionality to the site and can also install cookies.

If you find all of this confusing, please contact us through the Help section and we will guide you in installing and configuring Cookino appropriately.


Are cookies bad?

No. Cookies can be used for a lot of different things. For example, technical cookies are used to store user preferences or session information, analytical cookies are used to collect information about how the site is used, and cookies used by third-party products and software functions add functionality to the site.

For these types of cookies, the law does not require that the visitor be informed, and he may consent to their installation. However, the user must be informed if the cookies are profiling or advertising, and therefore create a user profile in order to send advertising messages based on his preferences.

Who does the profiling and why?

User profiling is done for marketing objectives. Typically, it is the site owner that inserts scripts in order to follow the habits of his visitors/customers and approach them with targeted advertising.

Is this profiling bad?

Not always; the user who chooses to be monitored can be reached by advertising in which he may be interested rather than by generic advertising. On the other side, these data could be misused in ways that are unrelated to the user.
In any instance, the law requires that the user be informed about profiling activities and have the option to consent to this practise by blocking or not blocking scripts (and cookies) in advance.

How can I prevent cookies from being installed?

To prevent scripts from installing cookies, you can use Cookino, which is a script (ironically... but does not track visitors) that, after proper configuration, can recognise and allow these scripts to be active only if the user authorises it.

Example of a script

An example of a simple script is shown below. This particular script displays a pop-up notification as soon as the page it is loaded:

<script type="text/javascript">
  alert("Hello, the script has been executed!");
</script>

Bloccare lo script con Cookino

We may utilise Cookino to stop any form of script unless the user agrees to its execution. Simply incorporate Cookino into your website and make the following changes to the code of the scripts you want to block:

  1. Change the type from text/javascript to text/plain;
  2. Add the data-cookino="stop" attribute.

As a result, the example script will be:

<script type="text/plain" data-cookino="stop">
    alert("Hello, the script has been executed!");
</script>

Changing the type prevents the browser from executing it, however changing the data attribute allows Cookino to detect and execute it only after the user has provided authorization.

Blocco avanzato degli script

Other adjustments may be required with some scripts.
For example, those that employ the <noscript> element to indicate alternative content to be displayed if users disable scripts or the browser does not support Javascript.

Simply, if a script with the <noscript> tag cannot be executed, the contents of the <noscript> tag are shown.

This tag's content may allow you to track the visitor in other ways. Since we are attempting to give the user the option to chose whether or not to be tracked, it must be blocked.

It can only be blocked by removing it. But don't worry, the script will continue to function normally (after user consent).

Let's add the <noscript> tag to the previous example:

<script type="text/javascript">
  alert("Hello, the script has been executed!");
</script>
<noscript>(There may be something here that allows data collecting.)</noscript>

To respect the user's requests and work appropriately with Cookino, it must be modified by altering the type, adding the data-cookino attribute, and deleting the <noscript> tag completely:

<script type="text/plain" data-cookino="stop">
    alert("Hello, the script has been executed!");
</script>

Verify that scripts are really blocked (debug mode)

Cookino has a debugging mode that lets you check that the scripts you want to block are really being blocked.


Enabling debug mode

This mode can be activated in two ways:

  1. By checking the Debug mode box in the management area (go to Your widgets and click on the edit button next to the widget).
    After making changes, you must copy and paste the updated code into the website;
  2. By manually altering the Cookino code on your website.

Modificare il codice manualmente premette di eseguire l'operazione più velocemente e senza dover fare copia e incolla del nuovo codice.

Questo di seguito è il tipico codice di Cookino che va installato nel proprio sito web. Le parti in verde sono le parti da aggiungere per attivare la modalità debug:

<!-- button.chat Cookino -->
    <script>
        var cookinoOptions = {
            debug: true
        };
    </script>
    <script id="cookino" src="https://widget.button.chat/cookino/p/cookino.js?key=xxx" data-policylink="https://www.websiteabc.xx"></script>
<!-- /button.chat Cookino -->

Note: Please keep in mind that the example refers to a fresh installation with no adjustments. If there are any adjustments, the options section will look different and have extra lines. To enable the feature, simply put debug: true at the bottom of the options.

The debug mode is now enabled and can be used to do all of the checks.


Using debug mode

To see the messages generated by Cookino in debug mode, open the browser console (how to open the browser console?).

If the debug mode is enabled, Cookino will provide a list of the scripts he has executed. If a script you want to block does not display in the list (after you have given consent to cookies in the Coockino window), it means that something isn't set up correctly.

Every line of the list will present two useful information to recognize which script Cookino was running. These informations are:

  • The src attribute (none will be displayed if the script is not external);
  • The first characters inside the <script> tag.


Example of the debug mode message

Useful information to understand which script it is are highlighted in bold:

Cookino - Script activated: src[url-of-the-script] - Content[first-characters-of-script]

This allows you to see which scripts Cookino has recognised and executed.

Make the Cookino window reappear after the user's choice

It's best to let the user open the Cookino window again to see how his consent is currently set up and maybe change it.

It's best to let the user open the Cookino window again to see how his consent is currently set up and maybe change it. It's generally best to put it below the cookie policy in the footer:

<a class="showCookinoPopup" href="#">Change cookie settings</a>

Sounds complicated?

Maybe it looks like it, maybe it is, but don't worry, if you have any problems, contact us via the support and we will assist you.

QSo, if you also want to block scripts in advance as the europena law requires and give users the possibility to decide whether to consent to the tracking of their habits, try Cookino on your site, free for 30 days... start here!

Se hai bisogno di assistenza fai click qui.