Questa procedura potrebbe richiedere degli adattamenti a seconda del sito e del CMS utilizzati, per questo si consiglia l’uso della classe PHP solo agli utenti più avanzati. Ti ricordiamo inoltre che JavaScript è richiesto per visualizzare il banner e la cookie policy.
Questa classe PHP permette di effettuare la scansione di una pagina in PHP e di bloccare automaticamente alcuni tra i codici/cookie più diffusi. È disponibile via download diretto o Packagist.
Ecco un esempio di integrazione:
<?php function iubenda_system( $html, $type = 'page' ) { if ( empty( $html ) ) return; require_once( 'iubenda.class.php' ); // separator if ( ! iubendaParser::consent_given() && ! iubendaParser::bot_detected() ) { $iubenda = new iubendaParser( $html, array( 'type' => in_array( $type, array( 'page', 'faster' ), true ) ? $type : 'page' ) ); $html = $iubenda->parse(); } // finished return $html; }
Il metodo iubenda_system
controlla se l’utente che sta visitando la pagina ha prestato o meno il consenso all’utilizzo dei cookie. Se l’utente ha già prestato il suo consenso, lo script restituisce l’HTML passato come parametro senza effettuare alcuna azione di parsing/replacing. Basta copiare il metodo nel documento PHP e chiamarlo con iubenda_system ("contenutohtml");
, che restituirà il codice.
<!--IUB-COOKIE-BLOCK-START-->
e <!--IUB-COOKIE-BLOCK-END-->
iframe
che contengono determinati src
script
che contengono determinati src
Queste operazioni avvengono nel rispetto delle regole illustrate in questa guida. In particolare, ti suggeriamo di consultare le voci circa l’alterazione dei tag script
, img
e degli iframe
.
Si prega di notare che al momento Privacy Controls and Cookie Solution è ottimizzata per rispettare la severa normativa italiana (ciò può solo migliorare la conformità alle altre giurisdizioni).
Per utilizzare la classe PHP di iubenda su CMS come Magento o PrestaShop non devi far altro che accedere alla cartella in cui si trovano i file di installazione del CMS Magento/PrestaShop, e poi seguire le seguenti istruzioni:
index.php
;require __DIR__ . "/iubenda.class.php";
dopo la prima riga;simple_html_dom.php
che puoi scaricare qui o utilizzando il pulsante in basso;iubenda.cookies.js
contenente il codice della tua iubenda Privacy Controls and Cookie Solution.Security Fix: limit url sanitize to http protocols
Fix: AddThis per-purpose category
New: Google AMP support from release v4.1.0
New: Per-purpose script blocking support
New: Reject button support
New: Introducing wildcard support for scripts and iframes
New: Introducing a way to skip specific script parsing
Tweak: Improved Youtube and Google Maps support
Tweak: Update composer.json autoloader
New: Option to block custom scripts and iframes
Tweak: Update and extend the list of blocked scripts including Google Site Search, Google oAuth, LinkedIn widgets, PayPal widgets, Pinterest, AddThis, Disqus, Optimizely, Neodata, Criteo, Outbrain, Headway, Codepen, Freshchat, UserVoice, AdRoll, Olark, Segment, Kissmetrics, Mixpanel, Pingdom, Bing and Elevio
Tweak: Update and unify iubenda parsing engine
Fixed a series of conflicts with UTF-8 special characters caused by the experimental parsing engine
Introduced a MUCH FASTER experimental parsing engine (visit the plugin options and select the experimental parsing engine) -> this one is called iubenda.class.faster.php and has a version number of 2.0.0, while the standard iubenda.class.php is still at 1.0.1
Created a new option that allow users to enable/disable the parsing engine and to select the parsing engine between stable and experimental
Introduction of the PHP Class. Now the plugin uses iubenda.class.php
Abbiamo preparato un’infografica sugli adempimenti richiesti dalla Cookie Law per facilitare l’analisi dei cookie ed in particolare per capire quando siano richiesti banner, consenso preventivo, notifica al Garante ecc. a seconda del tipo di cookie utilizzato.