Documentation

Table of Contents

Blocco preventivo dei cookie: tagging manuale (con esempi pratici)

La Cookie Solution di iubenda ti permette di gestire tutti gli adempimenti richiesti dalla Cookie Law:

  • cookie banner per la notifica agli utenti;
  • cookie policy per informazioni estese;
  • blocco preventivo degli script prima di aver ottenuto il consenso dell’utente;
  • salvataggio delle preferenze dell’utente.

Come installare la Cookie Solution di iubenda

Per maggiori informazioni sull’installazione, ti rimandiamo alla nostra guida dedicata o alla nostra introduzione alla Cookie Solution. Se utilizzi WordPress, ti segnaliamo invece il post Blocco preventivo dei cookie – Plugin WordPress.

Nota: la Cookie Solution richiede jQuery 1.4.4 o superiori per funzionare. Se non usi jQuery, iubenda se ne occuperà per te.

Quali script che installano cookie andrebbero bloccati preventivamente?

Dipende dalla giurisdizione legale applicabile al tuo sito. In Europa, sei obbligato a bloccare gli script dei cookie fino a quando non ottieni il consenso dell’utente. Tutti i cookie devono essere bloccati, eccetto alcune categorie esenti.

Per l’Italia, le categorie esenti sono:

Tabella riassuntiva

Infografica sugli adempimenti della Cookie Law

Google Analytics

In Italia, la condizione per cui Google Analytics può beneficiare di “nessun consenso preliminare necessario” è l’anonimizzazione dell’IP dell’utente, in quanto permette attività di analisi disaggregata (non è così in Francia, dove raccomandano l’uso di Matomo/Piwik).

È importante notare che, laddove si applica il GDPR, a seconda che sia richiesto o meno il consenso e di come vengono utilizzati, anche i dati statistici possono rientrare in “profilazione” o “monitoraggio”.

Come comportarsi:

  • Segui la guida all’anonimizzazione dell’IP di Google Analytics (ti basta aggiungere una riga al codice di configurazione);
  • In base alle informazioni disponibili, Webtrekk e molti altri strumenti di analytics sono già conformi agli standard e non richiedono ulteriori configurazioni.

Altri strumenti che garantiscono di non avvalersi di cookie

Qualora altri strumenti terzi garantiscano di non avvalersi di cookie, magari a condizione di utilizzare specifiche opzioni di configurazione, possono essere considerati anch’essi esenti dall’obbligo del blocco preventivo.

In particolare, questo è il caso di YouTube, che offre una funzionalità specifica per evitare che l’utente venga tracciato via cookie.

Come utilizzare Google Tag Manager per semplificare l’applicazione della normativa

Google Tag Manager è uno strumento gratuito che può semplificare l’applicazione della normativa. È compatibile con la iubenda Cookie Solution e gli abbiamo dedicato una guida.

Come descritto in seguito, Google Tag Manager ti permette di evitare il tagging degli script, limitatamente ad una certa categoria (gli script non posizionali). Consigliamo caldamente di utilizzarlo nonostante non sia la soluzione per tutti i casi: non gestisce infatti gli script di inclusione relativi a banner pubblicitari, widget video di YouTube, pulsanti “Mi piace” di Facebook, ecc.

Come implementare il blocco degli script che potrebbero installare cookie

Alterazione tag script

Per tutti gli altri script che installano o potrebbero installare cookie, è necessario procedere con delle modifiche al codice per implementare il blocco preventivo.

Per abilitare il blocco degli script che potrebbero installare cookie, è necessario modificare questi script in modo che il componente iubenda possa prevenirne l’esecuzione nei casi in cui non è stato ancora prestato il consenso.

Per farlo, si applica la classe _iub_cs_activate ai tag SCRIPT e si cambia l’attributo type da text/javascript a text/plain.

<script class="_iub_cs_activate" type="text/plain" src="code-source.js">
….
</script>

L’attributo src può rimanere invariato ma è preferibile sostituirlo con data-suppressedsrc (non disponibile sui canali current, beta e stable della versione legacy) oppure con suppressedsrc. La sostituzione di src in alcuni casi è necessaria in quanto il browser, nonostante lo script sia bloccato, può scaricare e/o interpretare la risorsa e di conseguenza installare dei cookie.

// use of data-suppressedsrc
<script data-suppressedsrc="LINK-TO-SOURCE.js" class="_iub_cs_activate" type="text/plain">

</script>


// OR suppressedsrc
<script suppressedsrc="LINK-TO-SOURCE.js" class="_iub_cs_activate"  type="text/plain">

</script>

Nota: nella riattivazione dello script, la iubenda Cookie Solution ricava l’attributo src di riattivazione controllando gli attributi descritti in precedenza nel seguente ordine: data-suppressedsrc (non disponibile sui canali current, beta e stable della versione legacy), suppressedsrc e src (se viene lasciato inalterato).

Per l’attivazione dei tag JavaScript inline occorre invece applicare la classe _iub_cs_activate-inline.

<script class="_iub_cs_activate-inline" type="text/plain">
….
</script>

Nota: la classe _iub_cs_activate-inline andrà utilizzata per tutti gli script che usano document.write o document.writeln.

Callback

In alternativa, nel caso in cui i cookie vengano attivati da porzioni di codice javascript, è possibile procedere tramite callback all’istanza csConfiguration.

// onConsentGiven is still active but deprecated: if both are declarated only onConsentRead will be executed.
_iub.csConfiguration = {
  callback: {
    onConsentRead: function(){ yourFunctionForRegisterCookie() ;}
  }
}

Nota: onConsentGiven, precedentemente indicata, rimane comunque disponibile per compatibilità con le versioni precedenti; il suo valore verrà in ogni caso sovrascritto da onConsentRead se quest’ultimo viene utilizzato.

Alterazione tag script, iframe e img per la gestione delle dipendenze

In alcuni casi, per attivare correttamente un tag bloccato è necessario attendere la disponibilità di una variabile o di un oggetto JavaScript. Per gestire correttamente le dipendenze è disponibile l’attributo data-iub-cs-wait-for (non disponibile sui canali current, beta e stable della versione legacy)

<script suppressedsrc="//download.helloworldvariable.js" class="_iub_cs_activate">
</script>

<script data-iub-cs-wait-for="helloWord" class="_iub_cs_activate-inline">
  console.log('print hello world' + helloWorld);
</script>

Tag img e iframe

Alcuni tag img e iframe potrebbero anche installare cookie. In questi casi è necessario aggiungere la classe _iub_cs_activate (come per i tag script descritti in precedenza), assegnare il valore originario del tag src a un nuovo attributo data-suppressedsrc (non disponibile sui canali current, beta e stable della versione legacy) oppure suppressedsrc ed assegnare all’attributo src il valore "//cdn.iubenda.com/cookie_solution/empty.html" (vedi anche l’esempio pratico in seguito).

<iframe id="player" class="_iub_cs_activate" width="640" height="390" frameborder="0" suppressedsrc="https://www.youtube.com/embed/erVv_Gm7CC4" src="//cdn.iubenda.com/cookie_solution/empty.html"></iframe>

Nota: il valore data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+ precedentemente indicato in questa guida (che è la codifica base64 di Suppressed, ed è ciò che la maggior parte dei browser mostrerebbe al posto del tag alterato prima della sua attivazione) non pregiudica il corretto blocco e la successiva attivazione del tag, ma il suo utilizzo potrebbe generare errori nella visualizzazione in alcune web view di Android.

A questo indirizzo è disponibile un coder/encode per poter generare la codifica base64 di una qualsiasi altra stringa.

Tag noscript

Allo stato attuale la gestione dei tag noscript che potrebbero installare cookie nel caso in cui l’utente abbia javascript disabilitato nel suo browser è in fase di implementazione. In attesa che anche questa casistica venga gestita consigliamo di eliminare i tag noscript dal documento o di ricorrere a soluzioni back-end che, interrogando la presenza del cookie _iub_cs-local, possano selettivamente includere o escludere i tag noscript dal documento.

Esempi pratici

Di seguito elencheremo una serie di casi frequenti e delle indicazioni su come modificare gli script per garantire un comportamento corretto rispetto agli obblighi imposti dalla Cookie Law.

Prima:

<script type="text/javascript">
       m3ads_system = "4WM";
       m3ads_partnernumber = 5000;
       m3ads_containerclass = "container class";
       m3ads_numberadverts = x;
       m3ads_logoimagewidth = xx;
       m3ads_logoimageheight = xx;
       m3ads_subpartner = "ads_subpartner";
       m3ads_customheader = x;
</script>
<script  type="text/javascript" src="//cdn.feed.4wnet.com/resources/scripts/jsAds-1.4.min.js"></script>

Dopo:

1. definisci la callBack per onConsentGiven sull’istanza _iub.csConfiguration

onConsentGiven: function () { 
$('.4wNET.hidden').removeClass('hidden');
}

2. includi l’intero script che carica il banner in un div con style="display:none"

<div class=”4wNET hidden” style=”display:none”>
    <script type="text/javascript">
         m3ads_system = "4WM";
         m3ads_partnernumber = 5000;
     m3ads_containerclass = "container class";
m3ads_numberadverts = x;
m3ads_logoimagewidth = xx;
m3ads_logoimageheight = xx;
m3ads_subpartner = "ads_subpartner";
m3ads_customheader = x;
    </script>
    <script  type="text/javascript" src="//cdn.feed.4wnet.com/resources/scripts/jsAds-1.4.min.js"></script>
</div>

Prima:

<script type="text/javascript">
        adroll_adv_id = "XXXXXXXXXXXXXXXXXXXXXX";
        adroll_pix_id = "XXXXXXXXXXXXXXXXXXXXXX";
        (function () {
            var oldonload = window.onload;
            window.onload = function () {
                __adroll_loaded = true;
                var scr = document.createElement("script");
                var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com");
                scr.setAttribute('async', 'true');
                scr.type = "text/javascript";
                scr.src = host + "/j/roundtrip.js";
                ((document.getElementsByTagName('head') || [null])[0] || document.getElementsByTagName('script')[0].parentNode).appendChild(scr);
                if (oldonload) {
                    oldonload()
                }
            };
        }());
</script>
<script type="text/javascript">
        adroll_conversion_value_in_dollars = 49.95;
        adroll_custom_data = {"ORDER_ID": "12345", "USER_ID":"98765"}
</script>
<script type="text/javascript">
        adroll_conversion_value = 10;
        adroll_currency = "USD"
</script>

Dopo:

<script type="text/plain" class="_iub_cs_activate">
        adroll_adv_id = "XXXXXXXXXXXXXXXXXXXXXX";
        adroll_pix_id = "XXXXXXXXXXXXXXXXXXXXXX";
        (function () {
            var oldonload = window.onload;
            //window.onload =
            function onLoad() {
                __adroll_loaded = true;
                var scr = document.createElement("script");
                var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com");
                scr.setAttribute('async', 'true');
                scr.type = "text/javascript";
                scr.src = host + "/j/roundtrip.js";
                ((document.getElementsByTagName('head') || [null])[0] ||       document.getElementsByTagName('script')[0].parentNode).appendChild(scr);
            };
            onLoad();
        }());
</script>
<script type="text/javascript">
        adroll_conversion_value_in_dollars = 49.95;
        adroll_custom_data = {"ORDER_ID": "12345", "USER_ID":"98765"}
</script>
<script type="text/javascript">
        adroll_conversion_value = 10;
        adroll_currency = "USD"
</script>

Prima (sincrono):

<script src="http://s7.addthis.com/js/250/addthis_widget.js"></script>

Dopo (sincrono):

<script type="text/plain"  class="_iub_cs_activate" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>

Prima (asincrono):

<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-555a0dcc7bd36db3" async="async"></script>

Dopo (asincrono):

<script type="text/plain" class="_iub_cs_activate" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-555a0dcc7bd36db3" async="async"></script>
Pulsante

Prima:

<script type="text/javascript">
var addthis_config = {
     pubid: "YOUR-PROFILE-ID"
}
</script>
<a href="http://www.addthis.com/bookmark.php?v=250" class="addthis_button">
<img   src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" border="0" alt="Share" />
</a>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js">
</script>

Dopo:

<script type="text/plain">
    var addthis_config = {
        pubid: "YOUR-PROFILE-ID"
    }
</script>
<a href="http://www.addthis.com/bookmark.php?v=250" class="addthis_button">
<img
src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif"
width="125" height="16" border="0" alt="Share" />
</a>
<script type="text/plain" class="_iub_cs_activate" src="http://s7.addthis.com/js/250/addthis_widget.js">

Prima:

<!-- AddToAny BEGIN -->
<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
  <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
  <a class="a2a_button_facebook"></a>
  <a class="a2a_button_twitter"></a>
  <a class="a2a_button_google_plus"></a>
</div>
<script async src="https://static.addtoany.com/menu/page.js"></script>

Dopo:

<!-- AddToAny BEGIN -->
<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
  <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
  <a class="a2a_button_facebook"></a>
  <a class="a2a_button_twitter"></a>
  <a class="a2a_button_google_plus"></a>
</div>
<script async type="text/plain" class="_iub_cs_activate" src="https://static.addtoany.com/menu/page.js"></script>

Prima:

<script type="text/javascript">
/* <![CDATA[ */
  document.write('<s'+'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=728X90/?ref='+encodeURIComponent(location.hostname+location.pathname)+'&r='+new Date().getTime()+'"></s'+'cript>');
/* ]]> */
</script>

Dopo:

È necessario aggiungere il riferimento alla risorsa Google Tag Manager all’interno del tag HEAD:

// add googletag file in tag head
<script type="text/plain" class="_iub_cs_activate">
        var googletag = googletag || {};
        googletag.cmd = googletag.cmd || [];
        (function() {
            var gads = document.createElement("script");
            gads.async = true;
            gads.type = "text/javascript";
            var useSSL = "https:" == document.location.protocol;
            gads.src = (useSSL ? "https:" : "http:") + "//www.googletagservices.com/tag/js/gpt.js";
            var node =document.getElementsByTagName("script")[0];
            node.parentNode.insertBefore(gads, node);
        })();
  </script>

A seguire modifica lo script originale di Altervista in questo modo:

<script class="_iub_cs_activate-inline" type="text/plain">
/* <![CDATA[ */
  document.write('<s'+'cript type="text/javascript" src="http://ad.altervista.org/js.ad/size=728X90/?ref='+encodeURIComponent(location.hostname+location.pathname)+'&r='+new Date().getTime()+'"></s'+'cript>');
/* ]]> */
</script>

Proponiamo infine un blocco alternativo, adatto per particolari configurazioni del banner AlterVista:

// Alternative block snippet for Altervista.
// If multiple banners exist in page, customize method's name basing on banner dimension or position. 
// Eg: renderBanner300250, renderBannerHeader
<body>

...
<script type="text/javascript">
  /*<![CDATA[*/
    function renderBannerX(){
      var src = "http://ALTERVISTA-AD-SCRIPT/size=YOUR-SIZE/?ref="+encodeURIComponent(location.hostname+location.pathname);
      var scriptClose = "<\/script>";
      var scriptForDocWrite = '<s'+'cript language=\"javascript\" src=\"'+src+'\">';
      return "<script type=\"text/javascript\">document.write('"+scriptForDocWrite+"');" + scriptClose;
    }  
  /*]]>*/
</script>
<script type="text/plain" class="_iub_cs_activate-inline">
    document.write(renderBannerX());
</script>
...

</body>
Banner

Prima:

<iframe src="http://rcm-eu.amazon-adsystem.com/e/cm?t=previsionivin-21&o=29&p=26&l=ur1&category=it_generic&banner=0JV8RQREJ41NGBW1S402&f=ifr" width="468" height="60" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe>

Dopo:

<iframe type="text/plain" class="_iub_cs_activate" src="data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+" suppressedsrc="http://rcm-eu.amazon-adsystem.com/e/cm?t=previsionivin-21&o=29&p=26&l=ur1&category=it_generic&banner=0JV8RQREJ41NGBW1S402&f=ifr" width="468" height="60" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe>
Login

Prima:

<div id="amazon-root"></div>
<button id="LoginWithAmazon" title="Login by Amazon"> login with Amazon </button>
<script type="text/javascript">

    window.onAmazonLoginReady = function() {
        amazon.Login.setClientId('YOUR-CLIENT-ID');
    };
    (function(d) {
        var a = d.createElement('script'); a.type = 'text/javascript';
        a.async = true; a.id = 'amazon-login-sdk';
        a.src = 'https://api-cdn.amazon.com/sdk/login1.js';
        d.getElementById('amazon-root').appendChild(a);
    })(document);

</script>
<script type="text/javascript">

    document.getElementById('LoginWithAmazon').onclick = function() {
        options = { scope : 'profile' };
        amazon.Login.authorize(options, 'https://www.example.com/handle_login.php');
        return false;
    };

</script>

Dopo:

<button id="LoginWithAmazon" title="Login by Amazon"> login with Amazon </button>
<script type="text/plain" class="_iub_cs_activate">

    window.onAmazonLoginReady = function() {
        amazon.Login.setClientId('YOUR-CLIENT-ID');
    };
    (function(d) {
        var a = d.createElement('script'); a.type = 'text/javascript';
        a.async = true; a.id = 'amazon-login-sdk';
        a.src = 'https://api-cdn.amazon.com/sdk/login1.js';
        d.getElementById('amazon-root').appendChild(a);
    })(document);

</script>
<script type="text/plain" class="_iub_cs_activate">

    document.getElementById('LoginWithAmazon').onclick = function() {
        options = { scope : 'profile' };
        amazon.Login.authorize(options, 'https://www.example.com/handle_login.php');
        return false;
    };

</script>

Prima:

<script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"TAG_ID"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script>
    <script> var uetq = uetq || [];  uetq.push({ 'gv': ORDER_TOTAL });</script>
    <noscript><img src="//bat.bing.com/action/0?ti=TAG_ID&Ver=2&gv=ORDER_TOTAL" height="0" width="0" style="display:none; visibility:hidden;" /></noscript>

Dopo:

<script type="text/plain" class="_iub_cs_activate">
        var ORDER_TOTAL = 10;
        (function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"TAG_ID"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");
    </script>
    <script> var uetq = uetq || [];  uetq.push({ 'gv': 10 });</script>
    <noscript>
      <img class="_iub_cs_activate" src="//cdn.iubenda.com/cookie_solution/empty.html"  suppressedsrc="//bat.bing.com/action/0?ti=TAG_ID&Ver=2&gv=ORDER_TOTAL" height="0" width="0" style="display:none; visibility:hidden;" />
    </noscript>

Prima:

<p>
  <ins class="bookingaff" data-aid="AFFILIATE-ID" 
     data-target_aid="AFFILIATE-ID" data-prod="DATA-PROD" data-width="100%" data-height="auto" data-lang="it" data-dest_id="-DEST-ID" data-dest_type="city" data-df_num_properties="3"> 
    <!-- Anything inside will go away once widget is loaded. --> 
    <a href="//www.booking.com?aid=AFFILIATE-ID">Booking.com</a> 
  </ins>
</p>
<script type="text/javascript">
// <![CDATA[
    (function(d, sc, u) {
      var s = d.createElement(sc), p = d.getElementsByTagName(sc)[0];
      s.type = 'text/javascript';
      s.async = true;
      s.src = u + '?v=' + (+new Date());
      p.parentNode.insertBefore(s,p);
      })(document, 'script', '//aff.bstatic.com/static/affiliate_base/js/flexiproduct.js');
// ]]>
</script>

Dopo:

<p>
  <ins class="bookingaff" data-aid="AFFILIATE-ID" 
     data-target_aid="AFFILIATE-ID" data-prod="DATA-PROD" data-width="100%" data-height="auto" data-lang="it" data-dest_id="-DEST-ID" data-dest_type="city" data-df_num_properties="3"> 
    <!-- Anything inside will go away once widget is loaded. --> 
    <a href="//www.booking.com?aid=AFFILIATE-ID">Booking.com</a> 
  </ins>
</p>
<script type="text/plain" class="_iub_cs_activate">
// <![CDATA[
    (function(d, sc, u) {
      var s = d.createElement(sc), p = d.getElementsByTagName(sc)[0];
      s.type = 'text/javascript';
      s.async = true;
      s.src = u + '?v=' + (+new Date());
      p.parentNode.insertBefore(s,p);
      })(document, 'script', '//aff.bstatic.com/static/affiliate_base/js/flexiproduct.js');
// ]]>
</script>

Prima:

    <p 
     data-default-tab="html,result"
     class="codepen">See the Pen <a href="URL"> </a></p>
    <p>
    <script async src="https://static.codepen.io/assets/embed/ei.js"></script></p>

Dopo:

    <p 
     data-default-tab="html,result"
     class="codepen">See the Pen <a href="URL"> </a></p>
    <p>
    <script type="text/plain" class="_iub_cs_activate" async src="https://static.codepen.io/assets/embed/ei.js"></script></p>

Prima:

<script>
        <!--//<![CDATA[
        document.MAX_ct0 ='';
        var m3_u = (location.protocol=='https:'?'https://cas.criteo.com/delivery/ajs.php?':'http://cas.criteo.com/delivery/ajs.php?');
        var m3_r = Math.floor(Math.random()*99999999999);
        document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
        document.write ("zoneid=ZONE-ID");document.write("&amp;nodis=1");
        document.write ('&amp;cb=' + m3_r);
        if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
        document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
        document.write ("&amp;loc=" + escape(window.location));
        if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
        if (document.context) document.write ("&context=" + escape(document.context));
        if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {
            document.write ("&amp;ct0=" + escape(document.MAX_ct0));
        }
        if (document.mmm_fo) document.write ("&amp;mmm_fo=1");

        document.write ("'></scr"+"ipt>");
        //]]>-->
</script>

Dopo:

L’URL della risorsa viene prima costruita interamente nel block code e poi inserita nella proprietà src del tag script.

<script type="text/plain" class="_iub_cs_activate-inline">
        <!--//<![CDATA[
        document.MAX_ct0 ='';
        var m3_u = (location.protocol=='https:'?'https://cas.criteo.com/delivery/ajs.php?':'http://cas.criteo.com/delivery/ajs.php?');
        var m3_r = Math.floor(Math.random()*99999999999);
        var src = m3_u+"zoneid=ZONEID&amp;nodis=1"+'&amp;cb=' + m3_r;
        if (document.MAX_used != ',')
            src += "&amp;exclude=" + document.MAX_used;
        if(document.charset)
            src +='&amp;charset='+document.charset
        else{
            if(document.characterSet)
                src +='&amp;charset='+document.characterSet
        }
        src +="&amp;loc=" + escape(window.location);
        if (document.referrer) src +="&amp;referer=" + escape(document.referrer);
        if (document.context)  src +="&context=" + escape(document.context);
        if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {
            src +="&amp;ct0=" + escape(document.MAX_ct0);
        }
        if (document.mmm_fo) src +="&amp;mmm_fo=1";
        document.write ("<scr"+"ipt type='text/javascript' src='"+src+"'>");
        document.write ("<\/scr"+"ipt>");
        //]]>-->
</script>

Prima:

  <script>
      window.customerlySettings = {
          app_id: "YOUR-APP-ID"
      };
      !function(){function e(){var e=t.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://widget.customerly.io/widget/YOUR-APP-ID";var r=t.getElementsByTagName("script")[0];r.parentNode.insertBefore(e,r)}var r=window,t=document,n=function(){n.c(arguments)};r.customerly_queue=[],n.c=function(e){r.customerly_queue.push(e)},r.customerly=n,r.attachEvent?r.attachEvent("onload",e):r.addEventListener("load",e,!1)}();
  </script>

Per un corretto funzionamento è sufficiente far caricare il sorgente al momento della riattivazione e non più all’evento onload, così:

Dopo:

<script type="text/plain" class="_iub_cs_activate">
    window.customerlySettings = { app_id: "YOUR-APP-ID" };
    !function(){
      function e(){
        var e=t.createElement("script");
        e.type="text/javascript",
        e.async=!0,
        e.src="https://widget.customerly.io/widget/YOUR-APP-ID";
        var r=t.getElementsByTagName("script")[0];
        r.parentNode.insertBefore(e,r)
      }
      var r=window,
      t=document,
      n=function(){
        n.c(arguments)
      };
      r.customerly_queue=[],
      n.c=function(e){
        r.customerly_queue.push(e)
      },
      r.customerly=n;
      e(); // run right away because onload event has already been triggered.
    }();
  </script>

Prima:

<div id="disqus_thread"></div>
<script>
    var disqus_shortname = 'example'; // required: replace example with your forum shortname
    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>

Dopo:

<script type="text/plain" class="_iub_cs_activate">
    var disqus_shortname = 'example'; // required: replace example with your forum shortname
    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>

Prima:

<script>
  !function(e,l,v,i,o,n){e[i]||(e[i]={}),e[i].account_id=n;var g,h;g=l.createElement(v),g.type="text/javascript",g.async=1,g.src=o+n,h=l.getElementsByTagName(v)[0],h.parentNode.insertBefore(g,h);e[i].q=[];e[i].on=function(z,y){e[i].q.push([z,y])}}(window,document,"script","_elev","https://cdn.elev.io/sdk/bootloader/v4/elevio-bootloader.js?cid=","YOUR-CODE");
  window._elev.on('load', function (_elev)  {

    _elev.setUser({
        email: "email",
        user_hash: "HASH",
      groups: ['Language=IT'],
    });

    _elev.setLanguage('en');

    _elev.setSettings({
    });

    _elev.setTranslations({
    });

  });
</script>

Dopo:

<script type="text/plain" class="_iub_cs_activate">
  !function(e,l,v,i,o,n){e[i]||(e[i]={}),e[i].account_id=n;var g,h;g=l.createElement(v),g.type="text/javascript",g.async=1,g.src=o+n,h=l.getElementsByTagName(v)[0],h.parentNode.insertBefore(g,h);e[i].q=[];e[i].on=function(z,y){e[i].q.push([z,y])}}(window,document,"script","_elev","https://cdn.elev.io/sdk/bootloader/v4/elevio-bootloader.js?cid=","YOUR-CODE");
  window._elev.on('load', function (_elev)  {

    _elev.setUser({
        email: "email",
        user_hash: "HASH",
      groups: ['Language=IT'],
    });

    _elev.setLanguage('en');

    _elev.setSettings({
    });

    _elev.setTranslations({
    });

  });
</script>
Like button

Prima:

<div id="fb-root"></div>
<script>
    (function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/it_IT/sdk.js#xfbml=1&version=v2.3";
  fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>

Dopo:

<div id="fb-root"></div>
<script type="text/plain" class="_iub_cs_activate">
  (function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/it_IT/sdk.js#xfbml=1&version=v2.3";
  fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
Like box

Prima:

  <div class="fb-like-box"
       data-width="245" data-height="290"
       data-href="http://www.facebook.com/digital.inspiration"
       data-border-color="#F4F4F4" data-show-faces="true"
       data-stream="false" data-header="false">
  </div>
  <div id="fb-root"></div>
  <script>
    (function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/it_IT/sdk.js#xfbml=1&version=v2.3&appId=210311129007974";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
  </script>

Dopo:

<div class="fb-like-box"
       data-width="245" data-height="290"
       data-href="http://www.facebook.com/digital.inspiration"
       data-border-color="#F4F4F4" data-show-faces="true"
       data-stream="false" data-header="false">
  </div>
  <div id="fb-root"></div>
    <script type="text/plain" class="_iub_cs_activate">
    (function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/it_IT/sdk.js#xfbml=1&version=v2.3&appId=210311129007974";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
    </script>
Page plugin

Prima:

<div class="fb-page" data-href="https://www.facebook.com/facebook" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-show-posts="true">
  <div class="fb-xfbml-parse-ignore">
    <blockquote cite="https://www.facebook.com/facebook">
      <a href="https://www.facebook.com/facebook">Facebook</a>
    </blockquote>
  </div>
</div>
<script>
    (function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/it_IT/sdk.js#xfbml=1&version=v2.3&appId=210311129007974";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
</script>

Dopo:

<div class="fb-page" data-href="https://www.facebook.com/facebook" data-small-header="false" data-adapt-container-width="true" data-hide-cover="false" data-show-facepile="true" data-show-posts="true">
  <div class="fb-xfbml-parse-ignore">
    <blockquote cite="https://www.facebook.com/facebook">
      <a href="https://www.facebook.com/facebook">Facebook</a>
    </blockquote>
  </div>
</div>
<script type="text/plain" class="_iub_cs_activate">
    (function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/it_IT/sdk.js#xfbml=1&version=v2.3&appId=210311129007974";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
    </script>
Pixel Code

Prima:

<script>
    !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
            n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
        n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
        t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
                    document,'script','https://connect.facebook.net/en_US/fbevents.js');
    fbq('init', PIXEL_ID); // Insert your pixel ID here.
    fbq('track', 'PageView');
</script>
<noscript>
    <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1456870647878776&ev=PageView&noscript=1"/>
</noscript>

Dopo:

<script type="text/plain" class="_iub_cs_activate">
    !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
            n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
        n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
        t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
                    document,'script','https://connect.facebook.net/en_US/fbevents.js');
    fbq('init', PIXEL_ID); // Insert your pixel ID here.
    fbq('track', 'PageView');
</script>
<noscript>
    <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1456870647878776&ev=PageView&noscript=1"/>
</noscript>

Prima:

<script type='text/javascript'>
        (function() {
            window.___fourSq = {"uid":"606"};
            var s = document.createElement('script');
            s.type = 'text/javascript';
            s.src = 'http://platform.foursquare.com/js/widgets.js';
            s.async = true;
            var ph = document.getElementsByTagName('script')[0];
            ph.parentNode.insertBefore(s, ph);
        })();
    </script>

Dopo:

<script type='text/plain' class="_iub_cs_activate">
        (function() {
            window.___fourSq = {"uid":"606"};
            var s = document.createElement('script');
            s.type = 'text/javascript';
            s.src = 'http://platform.foursquare.com/js/widgets.js';
            s.async = true;
            var ph = document.getElementsByTagName('script')[0];
            ph.parentNode.insertBefore(s, ph);
        })();
</script>

Prima:

<script type="text/javascript" src="https://wchat.freshchat.com/js/widget.js"></script>
<script type="text/javascript">
   window.fcWidget.init({
    token: TOKEN,
    host: "https://wchat.freshchat.com",
    locale: LANG,
    config: {
      ....
    }
  });
  window.fcWidget.user.setLocale('it');
</script>

Dopo:

<script type="text/javascript" src="https://wchat.freshchat.com/js/widget.js"></script>
<script type="text/javascript">
   window.fcWidget.init({
    token: TOKEN,
    host: "https://wchat.freshchat.com",
    locale: LANG,
    config: {
      ....
    }
  });
  window.fcWidget.user.setLocale('it');
</script>
Pulsante +1

Prima (asincrono):

<script type="text/javascript">
(function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>
<g:plusone></g:plusone>

Dopo (asincrono):

<script type="text/plain" class="_iub_cs_activate">
(function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>
<g:plusone></g:plusone>
Pulsante Accedi

Prima:

<span id="signinButton">
  ...
</span>
<script type="text/javascript">
(function() {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/client:plusone.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    })();
    function signinCallback(authResult) {
      if (authResult['access_token']) {
      } else if (authResult['error']) {
      }
    }
    function disconnectUser(access_token) {
      var revokeUrl = 'https://accounts.google.com/o/oauth2/revoke?token=' + access_token;
      $.ajax({
        type: 'GET',
        url: revokeUrl,
        async: false,
        contentType: "application/json",
        dataType: 'jsonp',
        success: function(nullResponse) {
        },
        error: function(e) {        }
      });
    }
    $('#revokeButton').click(disconnectUser);
  </script>

Dopo:

<span id="signinButton">
  ...
</span>
<script type="text/plain" class="_iub_cs_activate">
(function() {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/client:plusone.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    })();
    function signinCallback(authResult) {
      if (authResult['access_token']) {
      } else if (authResult['error']) {
      }
    }
    function disconnectUser(access_token) {
      var revokeUrl = 'https://accounts.google.com/o/oauth2/revoke?token=' + access_token;
      $.ajax({
        type: 'GET',
        url: revokeUrl,
        async: false,
        contentType: "application/json",
        dataType: 'jsonp',
        success: function(nullResponse) {
        },
        error: function(e) {        }
      });
    }
    $('#revokeButton').click(disconnectUser);
</script>

Nota: se mostri annunci personalizzati tramite i servizi di Google, devi prima assicurarti di aver raccolto il consenso esplicito alla personalizzazione degli annunci da parte degli utenti residenti nello Spazio economico europeo. Tutti i dettagli nella guida dedicata.

Prima:

<script type="text/javascript">
        google_ad_client = "ca-pub-00000000";
        google_ad_slot = "XXXXXXXXXX";
        google_ad_width = 728;
        google_ad_height = 90;
</script>
<script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script>

Dopo:

Definisci la callback onConsentGiven sull’istanza _iub.csConfiguration:

 <head>
 ...
  <script>
     _iub.csConfiguration = {
                           ...
         callback:{
                  onConsentGiven: function(){
                    var t = 1;
                    jQuery('._iub_cs_activate_google_ads').each(function() {
                        var banner = jQuery(this);
                        setTimeout(function(){
                            var client = banner.data('client');
                            var slot = banner.data('slot');
                            var width = banner.data('width');
                            var height = banner.data('height');
                            var adsense_script = '<scr'+'ipt type="text/javascript">\n'
                                    + 'google_ad_client = "'+client+'";'
                                    + 'google_ad_slot = "'+slot+'";'
                                    + 'google_ad_width = '+width+';'
                                    + 'google_ad_height = '+height+';'
                                    + '</scr'+'ipt>';
                            var script = document.createElement('script');
                            var ads = document.createElement('ads');
                            var w = document.write;
                            script.setAttribute('type', 'text/javascript');
                            script.setAttribute('src', 'http://pagead2.googlesyndication.com/pagead/show_ads.js');
                            document.write = (function(params) {
                                ads.innerHTML = params;
                                document.write = w;
                            });
                            banner.html(adsense_script).append(ads).append(script);
                        }, t);
                        t += 300;
                    });
                }
            }
            ..
        };
  </script>
..
</head>

<body>
         ...
<div style="width: 728px;height:90px;" class="_iub_cs_activate_google_ads"
         data-client="ca-pub-00000000"
         data-slot="XXXXXXXXXX"
         data-width="728"
         data-height="90">
</div>
...

</body>

Per ogni banner che appare all’interno della pagina crea un div e definisci i data in base ai parametri GoogleAd:

<div style="width: 728px;height:90px;" class="_iub_cs_activate_google_ads"
         data-client="ca-pub-00000000"
         data-slot="XXXXXXXXXX"
         data-width="728"
         data-height="90">
</div>
Asynch

Prima:

<script  type="text/javacript" async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- test -->
<ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="ca-pub-1535991029626362"
     data-ad-slot="1465347939"></ins>
<script  type="text/javascript">
    (adsbygoogle = window.adsbygoogle || []).push({});
</script>

Dopo:

<script async type="text/plain" class="_iub_cs_activate" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- orizzontale -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-XXX"
     data-ad-slot="XXXX"
     data-ad-format="auto"></ins>
<script type="text/plain" class="_iub_cs_activate" >
    (adsbygoogle = window.adsbygoogle || []).push({});
</script>

Quanto segue va implementato solo se si utilizzano le funzioni di Google Analytics che permettono il tracciamento univoco dell’utente. In tutti gli altri casi si suggerisce di anonimizzare l’IP.

gtag.js

Prima:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
</script>

Dopo:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script type="text/plain" class="_iub_cs_activate" async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
</script>
analytics.js

Prima:

<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->

Dopo:

<!-- Google Analytics -->
<script type="text/plain" class="_iub_cs_activate">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->

Prima:

    <iframe width="573" height="446" frameborder="0" scrolling="no" style=" border-width:0 " src="http://www.google.com/calendar/hosted/YOURURL"></iframe>

Dopo:

    <iframe width="573" height="446" frameborder="0" scrolling="no" style=" border-width:0 " class="_iub_cs_activate" src="data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+" suppressedsrc="http://www.google.com/calendar/hosted/YOURURL"></iframe>

Nota: presta attenzione a questa parte, class="_iub_cs_activate" src="data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+" suppressedsrc="

Prima:

<script type="text/javascript">
          (function() {
              var link_element = document.createElement("link"),
                      s = document.getElementsByTagName("script")[0];
              if (window.location.protocol !== "http:" && window.location.protocol !== "https:") {
                  link_element.href = "http:";
              }
              link_element.href += "//fonts.googleapis.com/css?family=FAMILY";
              link_element.rel = "stylesheet";
              link_element.type = "text/css";
              s.parentNode.insertBefore(link_element, s);
          })();
</script>

Dopo:

<script class="_iub_cs_activate" type="text/plain">
            (function() {
                var link_element = document.createElement("link"),
                    s = document.getElementsByTagName("script")[0];
                if (window.location.protocol !== "http:" && window.location.protocol !== "https:") {
                    link_element.href = "http:";
                }
                link_element.href += "//fonts.googleapis.com/css?family=FAMILY";
                link_element.rel = "stylesheet";
                link_element.type = "text/css";
                s.parentNode.insertBefore(link_element, s);
            })();
</script>

Prima (asincrono):

<script>
          function initialize() {
              var mapOptions = {
                  zoom: 8,
                  center: new google.maps.LatLng(-34.397, 150.644)
              };
              var map = new google.maps.Map(document.getElementById('map-canvas'),
                      mapOptions);
          }

          function loadScript() {
              var script = document.createElement('script');
              script.type = 'text/javascript';
              script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp' +
                      '&signed_in=true&callback=initialize';
              document.body.appendChild(script);
          }
          window.onload = loadScript;
      </script>

Dopo (asincrono):

<script type="text/plain"  class="_iub_cs_activate">
          function initialize() {
              var mapOptions = {
                  zoom: 8,
                  center: new google.maps.LatLng(-34.397, 150.644)
              };
              var map = new google.maps.Map(document.getElementById('map-canvas'),
                      mapOptions);
          }
          function loadScript() {
              var script = document.createElement('script');
              script.type = 'text/javascript';
              script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp' +
                      '&signed_in=true&callback=initialize';
              document.body.appendChild(script);
          }
          loadScript();
          //window.onload = loadScript();
</script>

Prima (asincrono con api key):

<script async defer src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=YOUR_KEY&callback=initMap"></script>
<script>
  var map;
  function initMap() {
    map = new google.maps.Map(document.getElementById(YOUR-DIV-ID), {
      center: {lat: YOUR_LAT, lng: YOUR_LNG},
      zoom: YOUR_ZOOM
    });
  }
</script>

Dopo (asincrono con api key):

<script>
  var map;
  function initMap() {
    map = new google.maps.Map(document.getElementById(YOUR-DIV-ID), {
      center: {lat: YOUR_LAT, lng: YOUR_LNG},
      zoom: YOUR_ZOOM
    });
  }
</script>
// BLOCK CODE SOURCE
<script type="text/plain" class="_iub_cs_activate" async defer src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=YOUR_KEY&callback=initMap"></script>

Prima (sincrono):

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
      <script>
          var map;
          function initialize() {
              var mapOptions = {
                  zoom: 8,
                  center: new google.maps.LatLng(-34.397, 150.644)
              };
              map = new google.maps.Map(document.getElementById('googleMap'),
                      mapOptions);
          }
          google.maps.event.addDomListener(window, 'load', initialize);
      </script>

Dopo (sincrono):

<script src="http://maps.googleapis.com/maps/api/js?v=3.exp"></script>
      <script type="text/plain" class="_iub_cs_activate">
        var map;
        function initialize() {
              var mapOptions = {
                  zoom: 8,
                  center: new google.maps.LatLng(-34.397, 150.644)
              };
              map = new google.maps.Map(document.getElementById('googleMap'),
                      mapOptions);
        }
        initialize();
        //google.maps.event.addDomListener(window, 'load', initialize);
        </script>
iframe

Prima:

<iframe width="600" height="450" frameborder="0" style="border:0" src="https://www.google.com/maps/embed?pb=!1m23!1m12!1m3!1d47525.82470843965!2d12.530161413183587!3d41.88502730861466!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!4m8!3e6!4m0!4m5!1s0x132f6196f9928ebb%3A0xb90f770693656e38!2sRome%2C+Italy!3m2!1d41.9027835!2d12.4963655!5e0!3m2!1sen!2sde!4v1436895739887"></iframe>

Dopo:

<iframe class="_iub_cs_activate" width="600" height="450" frameborder="0" style="border:0" src="//cdn.iubenda.com/cookie_solution/empty.html" suppressedsrc="https://www.google.com/maps/embed?pb=!1m23!1m12!1m3!1d47525.82470843965!2d12.530161413183587!3d41.88502730861466!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!4m8!3e6!4m0!4m5!1s0x132f6196f9928ebb%3A0xb90f770693656e38!2sRome%2C+Italy!3m2!1d41.9027835!2d12.4963655!5e0!3m2!1sen!2sde!4v1436895739887" allowfullscreen>
      </iframe>

Nota: se mostri annunci personalizzati tramite i servizi di Google, devi prima assicurarti di aver raccolto il consenso esplicito alla personalizzazione degli annunci da parte degli utenti residenti nello Spazio economico europeo. Tutti i dettagli nella guida dedicata.

Prima:

<head>
  …
  <script type="text/javascript">
      var googletag = googletag || {};
      googletag.cmd = googletag.cmd || [];
      (function () {
          var gads = document.createElement("script");
          gads.async = true;
          gads.type = "text/javascript";
          var useSSL = "https:" == document.location.protocol;
          gads.src = (useSSL ? "https:" : "http:") + "//www.googletagservices.com/tag/js/gpt.js";
          var node = document.getElementsByTagName("script")[0];
          node.parentNode.insertBefore(gads, node);
      })();
  </script>
  <script type="text/javascript">
      googletag.cmd.push(function () {
          googletag.pubads().set("adsense_background_color", "FFFFFF");
      });
  </script>
  <script>
      googletag.cmd.push(function () {
          googletag.defineSlot("/1234/travel/asia/food", [728, 90], "div-gpt-ad-123456789-0")
                  .addService(googletag.pubads())
                  .setTargeting("interests", ["sports", "music", "movies"]);
          googletag.defineSlot("/1234/travel/asia/food", [
                      [468, 60],
                      [728, 90],
                      [300, 250]
                  ], "div-gpt-ad-123456789-1")
                  .addService(googletag.pubads())
                  .setTargeting("gender", "male")
                  .setTargeting("age", "20-30");
          googletag.pubads().setTargeting("topic", "basketball");
          googletag.pubads().enableSingleRequest();
          googletag.enableServices();
      });
  </script>
  ...
</head>
<body>
..

<div id="div-gpt-ad-123456789-0" style="width: width; height: height;">
  <script type="text/javascript">
      googletag.cmd.push(function () {
          googletag.display("div-gpt-ad-123456789-0");
      });
  </script>
</div>
<div id="div-gpt-ad-123456789-1" STYLE="height:height;width:width;">
  <script type="text/javascript">
      googletag.cmd.push(function () {
          googletag.display("div-gpt-ad-123456789-1");
      });
  </script>
</div>

..
</body>

Dopo:

<head>
  ..
  <script type="text/plain" class="_iub_cs_activate">
        var googletag = googletag || {};
        googletag.cmd = googletag.cmd || [];
        (function() {
            var gads = document.createElement("script");
            gads.async = true;
            gads.type = "text/javascript";
            var useSSL = "https:" == document.location.protocol;
            gads.src = (useSSL ? "https:" : "http:") + "//www.googletagservices.com/tag/js/gpt.js";
            var node =document.getElementsByTagName("script")[0];
            node.parentNode.insertBefore(gads, node);
        })();

  </script>
  <script type="text/plain" class="_iub_cs_activate">
        googletag.cmd.push(function() {
            googletag.pubads().set("adsense_background_color", "FFFFFF");
        });

  </script>
  <script type="text/plain" class="_iub_cs_activate">
        googletag.cmd.push(function() {
              googletag.defineSlot("/6355419/Travel/Europe/France/Paris", [728, 90], "div-gpt-ad-123456789-0")
                .addService(googletag.pubads())
                .setTargeting("interests", ["sports", "music", "movies"]);
              googletag.defineSlot("/1234/travel/asia/food", [[468, 60], [728, 90], [300, 250]], "div-gpt-ad-123456789-1")
                .addService(googletag.pubads())
                .setTargeting("gender", "male")
                .setTargeting("age", "20-30");
              googletag.pubads().setTargeting("topic","basketball");
              googletag.pubads().enableSingleRequest();
              googletag.enableServices();
            });

  </script>
  ..
</head>
<body>
..
<div id="div-gpt-ad-123456789-0" style="width: width; height: height;">
  <script type="text/plain" class="_iub_cs_activate">
          googletag.cmd.push(function () {
              googletag.display("div-gpt-ad-123456789-0");
          });

  </script>
</div>
<div id="div-gpt-ad-123456789-1" STYLE="height: height;width: width;">
  <script type="text/plain" class="_iub_cs_activate">
          googletag.cmd.push(function () {
              googletag.display("div-gpt-ad-123456789-1");
          });

  </script>
</div>
..
</body>

Prima:

<img src='http://pubads.g.doubleclick.net/gampad/ad?iu=/ui_id/ad_unit&sz=1x1&t=&c=c_id'/>

Dopo:

<img class="_iub_cs_activate" src="data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+" suppressedsrc='http://pubads.g.doubleclick.net/gampad/ad?iu=/ui_id/ad_unit&sz=1x1&t=&c=c_id'/>

Prima:

<script type="text/javascript">
    var HW_config = {
        selector: ".unread-wrap",
        account: "EyoVWJ",
        translations: {
            title: "Last updates",
        }
    };
</script>
<script async type="text/javascript" src="//cdn.headwayapp.co/widget.js"></script>

Dopo:

<script type="text/javascript">
    var HW_config = {
        selector: ".unread-wrap",
        account: "EyoVWJ",
        translations: {
            title: "Last updates",
        }
    };
</script>
<script async type="text/plain" class="_iub_cs_activate" src="//cdn.headwayapp.co/widget.js"></script>

Prima:

<script type="text/javascript">
  (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/lnwa03kw';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();        
   window.intercomSettings = {
     app_id: "YOUR-APP-ID"
   };
</script>

Per un corretto funzionamento è sufficiente far caricare il sorgente al momento della riattivazione e non più all’evento onload, così:

Dopo:

<script type="text/plain" class="_iub_cs_activate">
  
  (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);    } else {
      var d=document;
      var i=function(){i.c(arguments)};
      i.q=[]; i.c=function(args){i.q.push(args)};w.Intercom=i;
      function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/lnwa03kw';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}
      
      l(); // call the method without waiting for the onload event
    }
  })();
  
  window.intercomSettings = {
    app_id: 'YOUR-APP-ID'
  };
  
</script>

Su Internet Explorer (nelle versioni che vanno dalla 11 alla 7) durante l’elaborazione del consenso apparirà un messaggio di errore nel box del banner. Il messaggio di errore sparirà una volta finita la procedura di attivazione.

Prima:

<iframe marginwidth="0" marginheight="0" frameborder="0" scrolling="no" allowtransparency="true" src="http://srv.juiceadv.com/banner_iframe.asp?user=2630&amp;tipo=20" width="250" height="250"></iframe>

Dopo:

<iframe marginwidth="0" marginheight="0" frameborder="0" scrolling="no" allowtransparency="true" type="text/plain" class="_iub_cs_activate" src="data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+" suppressedsrc="http://srv.juiceadv.com/banner_iframe.asp?user=2630&amp;tipo=20" width="250" height="250"></iframe>

Prima:

<script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-00000000-1']);
        _gaq.push(['_trackPageview']);
        (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
</script>
<!-- KISSmetrics tracking snippet -->
<script type="text/javascript" >
        var _kmq = _kmq || [];
        var _kmk = _kmk || 'foo';
        function _kms(u){
          setTimeout(function(){
              var d = document, f = d.getElementsByTagName('script')[0],
                      s = d.createElement('script');
              s.type = 'text/javascript'; s.async = true; s.src = u;
              f.parentNode.insertBefore(s, f);
          }, 1);
        }
        _kms('//i.kissmetrics.com/i.js');
        _kms('//scripts.kissmetrics.com/' + _kmk + '.2.js');
</script>

Dopo:

<script type="text/plain" class="_iub_cs_activate">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-00000000-1']);
        _gaq.push(['_trackPageview']);
        (function() {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
</script>
<!-- KISSmetrics tracking snippet -->
<script type="text/plain"  class="_iub_cs_activate">
        var _kmq = _kmq || [];
        var _kmk = _kmk || 'e76b907358e7b934865c0d9319153da8a43008c1';
        function _kms(u){
          setTimeout(function(){
              var d = document, f = d.getElementsByTagName('script')[0],
                      s = d.createElement('script');
              s.type = 'text/javascript'; s.async = true; s.src = u;
              f.parentNode.insertBefore(s, f);
          }, 1);
        }
        _kms('//i.kissmetrics.com/i.js');
        _kms('//scripts.kissmetrics.com/' + _kmk + '.2.js');
</script>

Prima:

<script type="text/javascript" src="http://mediamond.js.ad.dotandad.com/MediamondAds.js" language="javascript" id="mediamondBaseJS"></script>
<script type="text/javascript" language="javascript">
var mediamondAd=new MediamondAds();
mediamondAd.setTagPfx("page-prefix");
mediamondAd.setFifPath("/"); 
mediamondAd.setPositionsList("1o_u,sn_u,rn_u,rn_2,rn_3,rn_4,rn_5,rn_6,rn_7,rn_8,rn_9,rn_10,bp_1,bp_2,bp_3,bp_4,bp_5");
mediamondAd.setFunGen("fun-gen");
mediamondAd.setResponsiveSizes({"pixel":"x"});
try{mediamondAd.setKeywords("");}catch(e){}
mediamondAd.setDNT(-1);
mediamondAd.callAdserver();
</script>

Dopo:

<script type=”text/javascript”>
  function iubendaIsConsentGiven(){
            if( 'consentIsGiven' in window && (consentIsGiven === true || consentIsGiven === false)) 
    return consentIsGiven;
            if(!('_iub' in window && 'csConfiguration' in _iub)) return false;
            var siteId = _iub.csConfiguration.siteId || '';
            var cookiePolicyId = _iub.csConfiguration.cookiePolicyId || '';
            var cs = document.cookie.split(';');
            var consentIsGiven = false;
            for (var i = 0; i < cs.length; i++) {
                while (cs[i].charAt(0) == ' ') cs[i] = cs[i].substring(1);
                if(cs[i].indexOf('_iub_cs-s'+ siteId) == 0||cs[i].indexOf('_iub_cs-'+ cookiePolicyId) == 0) {
                    consentIsGiven = true;
                    break;
                }
            }
            window.consentIsGiven = consentIsGiven;
            return consentIsGiven;
}
</script>
<script type="text/javascript" src="http://mediamond.js.ad.dotandad.com/MediamondAds.js" language="javascript" id="mediamondBaseJS"></script>
<script type="text/javascript" language="javascript">
var mediamondAd=new MediamondAds();
mediamondAd.setTagPfx("page-prefix");
mediamondAd.setFifPath("/"); 
mediamondAd.setPositionsList("1o_u,sn_u,rn_u,rn_2,rn_3,rn_4,rn_5,rn_6,rn_7,rn_8,rn_9,rn_10,bp_1,bp_2,bp_3,bp_4,bp_5");
mediamondAd.setFunGen("fun-gen");
mediamondAd.setResponsiveSizes({"pixel":"x"});
try{mediamondAd.setKeywords("");}catch(e){}
if (typeof iubendaIsConsentGiven == 'function' && typeof _iub.csConfiguration !== "undefined") {
           var isConsentGiven  = iubendaIsConsentGiven(  _iub.csConfiguration.siteId,
                                                                                                       _iub.csConfiguration.cookiePolicyId);
  if (!isConsentGiven) mediamondAd.setDNT(-1);
}
mediamondAd.callAdserver();
</script>

Prima:

<script type="text/javascript">
(function(f,b){if(!b.__SV){
var a,e,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=f.createElement("script");a.type="text/javascript";a.async=!0;a.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";e=f.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}})(document,window.mixpanel||[]);
mixpanel.init("YOUR TOKEN");
</script>

Dopo:

<script  type="text/plain"  class="_iub_cs_activate">
(function(f,b){if(!b.__SV){
var a,e,i,g;window.mixpanel=b;b._i=[];b.init=function(a,e,d){function f(b,h){var a=h.split(".");2==a.length&&(b=b[a[0]],h=a[1]);b[h]=function(){b.push([h].concat(Array.prototype.slice.call(arguments,0)))}}var c=b;"undefined"!==typeof d?c=b[d]=[]:d="mixpanel";c.people=c.people||[];c.toString=function(b){var a="mixpanel";"mixpanel"!==d&&(a+="."+d);b||(a+=" (stub)");return a};c.people.toString=function(){return c.toString(1)+".people (stub)"};i="disable track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(g=0;g<i.length;g++)f(c,i[g]);b._i.push([a,e,d])};b.__SV=1.2;a=f.createElement("script");a.type="text/javascript";a.async=!0;a.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";e=f.getElementsByTagName("script")[0];e.parentNode.insertBefore(a,e)}})(document,window.mixpanel||[]);
mixpanel.init("YOUR TOKEN");
</script>

Prima:

<script type="text/javascript" defer="defer" src="https://mylivechat.com/chatinline.aspx?hccid=90864984"></script>

Dopo:

<script type="text/plain" class="_iub_cs_activate" src="data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+" suppressedsrc="https://mylivechat.com/chatinline.aspx?hccid=90864984"></script>

Prima:

<script type="text/javascript"><!--//<![CDATA[
   var m3_u = (location.protocol=='https:'? YOUR_DELIVERY_URL : YOUR_DELIVERY_URL);
   var m3_r = Math.floor(Math.random()*99999999999);
   if (!document.MAX_used) document.MAX_used = ',';
   document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
   document.write ("?zoneid=12");
   document.write ('&amp;cb=' + m3_r);
   if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
   document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
   document.write ("&amp;loc=" + escape(window.location));
   if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
   if (document.context) document.write ("&context=" + escape(document.context));
   if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
   document.write ("'><\/scr"+"ipt>");
//]]>--></script>
<noscript><a href='YOUR_URL' target='_blank'><img src='YOUR_TRACKING_URL' border='0' alt='' /></a></noscript>

Dopo:

L’URL della risorsa viene prima costruita interamente nel block code e poi inserita nella proprietà src del tag script:

  <script type='text/plain' class='_iub_cs_activate-inline'><!--//<![CDATA[
        var m3_u = (location.protocol=='https:'? YOUR_DELIVERY_URL : YOUR_DELIVERY_URL);
        var m3_r = Math.floor(Math.random()*99999999999);
        var src = m3_u+"?zoneid=10"+'&amp;cb=' + m3_r;
        if (document.MAX_used != ',')
            src += "&amp;exclude=" + document.MAX_used;
        if(document.charset)
            src +='&amp;charset='+document.charset
        else{
            if(document.characterSet)
                src +='&amp;charset='+document.characterSet
        }
        src +="&amp;loc=" + escape(window.location);
        if (document.referrer) src +="&amp;referer=" + escape(document.referrer);
        if (document.context)  src +="&context=" + escape(document.context);
        if (document.mmm_fo) src +="&amp;mmm_fo=1";
        document.write ("<scr"+"ipt type='text/javascript' src='"+src+"'>");
        document.write ("<\/scr"+"ipt>");
//]]>-->
        </script><noscript><a href='YOUR_URL' target='_blank'><img src='YOUR_TRACKING_URL' border='0' alt='' /></a></noscript>
// document write will be used once src has been defined

Nota: puoi velocizzare l’attivazione – qualora avessi numerosi banner OpenX in un’unica pagina – utilizzando l’opzione inlineDelay (per maggiori informazioni consulta la guida Banner e raccolta del consenso – Installazione e personalizzazione ). Ti consigliamo inoltre di non indicare valori inferiori a 200 millisecondi.

Prima:

<head>
..
      <script src="//cdn.optimizely.com/js/3129550290.js"></script>
..    
</head>

Dopo:

<head>
..
    <script type="text/plain" class="_iub_cs_activate" src="//cdn.optimizely.com/js/3129550290.js"></script>
..
</head>

Prima:

<script src="https://www.paypalobjects.com/js/external/paypal-button.min.js?merchant=YOUR_MERCHANT_ID"
            data-button="buynow"
            data-name="My product"
            data-amount="1.00"
            async></script>

Dopo:

<script type="text/plain" class="_iub_cs_activate" src="https://www.paypalobjects.com/js/external/paypal-button.min.js?merchant=YOUR_MERCHANT_ID"
            data-button="buynow"
            data-name="My product"
            data-amount="0.01"
            async
    ></script>

Prima:

<head>
..
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
..
</head>
<body>
..
<form action="?" method="POST">
  <div id="html_element"></div>
  <br>
  <div class="g-recaptcha" data-sitekey="SITE-KEY"></div>
  <input type="submit" value="Submit">
</form>
..
</body>

Dopo:

<head>
..
<script type="text/plain" class="_iub_cs_activate" src="https://www.google.com/recaptcha/api.js" async defer></script>
..
</head>
<body>
..
<form action="?" method="POST">
  <div id="html_element"></div>
  <br>
  <div class="g-recaptcha" data-sitekey="SITE-KEY"></div>
  <input type="submit" value="Submit">
</form>
..
</body>

Prima:

<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
 <script>
    stLight.options({
        publisher:'insert-your-key-here'
    });

    stWidget.addEntry({
        "service":"sharethis",
        "element":document.getElementById('button_1'),
        "url":"http://sharethis.com",
        "title":"sharethis",
        "type":"large",
        "text":"ShareThis" ,
        "image":"http://www.softicons.com/download/internet-icons/social-superheros-icons-by-iconshock/png/256/sharethis_hulk.png",
    "summary":"this is description1"
    });

    stWidget.addEntry({
        "service":"sharethis",
        "element":document.getElementById('button_2'),
        "url":"http://sharethis.com/2",
        "title":"sharethis",
        "type":"large",
        "text":"ShareThis" ,
        "image":"http://farm4.static.flickr.com/3571/3427619794_13dae8e979_o.png",
        "summary":"this is description2"
    });

    function addMore(){
        stWidget.addEntry({
            "service":"sharethis",
            "element":document.getElementById('button_3'),
            "url":"http://sharethis.com/3",
            "title":"sharethis",
            "type":"large",
            "text":"ShareThis" ,
            "image":"http://icons.iconarchive.com/icons/iconshock/high-detail-social/256/sharethis-icon.png",
            "summary":"this is description3"
        });
    }
</script>

Dopo:

<script type="text/plain" class="_iub_cs_activate" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/plain" >

    stLight.options({
        publisher:'insert-your-key-here'
    });

    stWidget.addEntry({
        "service":"sharethis",
        "element":document.getElementById('button_1'),
        "url":"http://sharethis.com",
        "title":"sharethis",
        "type":"large",
        "text":"ShareThis" ,
        "image":"http://www.softicons.com/download/internet-icons/social-superheros-icons-by-iconshock/png/256/sharethis_hulk.png",
    "summary":"this is description1"
    });

    stWidget.addEntry({
        "service":"sharethis",
        "element":document.getElementById('button_2'),
        "url":"http://sharethis.com/2",
        "title":"sharethis",
        "type":"large",
        "text":"ShareThis" ,
        "image":"http://farm4.static.flickr.com/3571/3427619794_13dae8e979_o.png",
        "summary":"this is description2"
    });

    function addMore(){
        stWidget.addEntry({
            "service":"sharethis",
            "element":document.getElementById('button_3'),
            "url":"http://sharethis.com/3",
            "title":"sharethis",
            "type":"large",
            "text":"ShareThis" ,
            "image":"http://icons.iconarchive.com/icons/iconshock/high-detail-social/256/sharethis-icon.png",
            "summary":"this is description3"
        });
    }
</script>
Smart Hovering Bar

Prima (asincrono):

<script type="text/javascript">
  var switchTo5x=true;
    (function() {
    var stscr = document.createElement('script'); stscr.type = 'text/javascript'; stscr.async = true;
      stscr.src ="http://w.sharethis.com/button/buttons.js";
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(stscr, s);
    stscr.onload=stCB;
    stscr.onreadystatechange=function(){if(stscr.readyState=='loaded'){stCB();}};})();
    function stCB(){
      stLight.options({
          publisher:'6beba854-ee6d-4ae1-a4f3-b69815c8ef63'
        });
    }
  </script>
  <script type="text/javascript">
    var timeOut = null;
    var shiftButtons = function() { 
    var sharebox = document.getElementById('sharebox');
    if(document.documentElement.clientWidth<1100){
      document.getElementById('verticalbuttons').style.display='none';
      document.getElementById('horizontalbuttons').style.display='block';  
      sharebox.style.position="relative";
      sharebox.style.left="auto";
      sharebox.style.top="auto";
      sharebox.style.marginBottom="6px";
      sharebox.style.marginLeft="auto";
      sharebox.style.marginRight="auto";
      sharebox.style.width="500px";
    } else {
      sharebox.style.position="fixed";
      sharebox.style.left="50%";
      sharebox.style.marginLeft="-566px";
      sharebox.style.top="20px";
      sharebox.style.width="90px";
      document.getElementById('verticalbuttons').style.display='block';
      document.getElementById('horizontalbuttons').style.display='none';
    }
  };
    
  window.onresize = function(){
     if(timeOut != null) clearTimeout(timeOut);
     setTimeout(shiftButtons, 1000);
  };
</script>

<div id="sharebox" style="position: fixed; left: 50%; top: 20px; margin-left: -566px;">
  <div id="horizontalbuttons" style="display:none">
    <span class="st_fblike_hcount" displayText="ShareThis"></span>
    <span class="st_twitter_hcount" displayText="ShareThis"></span>
    <span class="st_sharethis_button" displayText="ShareThis"></span>
    <span class="st_email_button" displayText="Email"></span>
  </div>
  <div id="verticalbuttons">
    <span class="st_fblike_vcount" displayText="ShareThis"></span><br/>
    <span class="st_twitter_vcount" displayText="ShareThis"></span><br/>
    <span class="st_sharethis_vcount" displayText="ShareThis"></span><br/>
    <span class="st_email_button" displayText="Email"></span><br/>
  </div>
</div>

Dopo (asincrono):

<script class="_iub_cs_activate-inline" type="text/plain">
      var switchTo5x=true;
      (function() {
        var stscr = document.createElement('script'); stscr.type = 'text/javascript'; stscr.async = true;
        stscr.src ="http://w.sharethis.com/button/buttons.js";
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(stscr, s);
        stscr.onload=stCB;
        stscr.onreadystatechange=function(){if(stscr.readyState=='loaded'){stCB();}};}
      )();
      function stCB(){
            stLight.options({
                    publisher:'e06c2f3092ca86c408bf781f8806b81f'
                });
      }
  </script>
  <script class="_iub_cs_activate" type="text/plain">
    var timeOut = null;
    var shiftButtons = function() {
    var sharebox = document.getElementById('sharebox');
    if(document.documentElement.clientWidth<1100){
      document.getElementById('verticalbuttons').style.display='none';
      document.getElementById('horizontalbuttons').style.display='block';
      sharebox.style.position="relative";
      sharebox.style.left="auto";
      sharebox.style.top="auto";
      sharebox.style.marginBottom="6px";
      sharebox.style.marginLeft="auto";
      sharebox.style.marginRight="auto";
      sharebox.style.width="500px";
    } else {
      sharebox.style.position="fixed";
      sharebox.style.left="50%";
      sharebox.style.marginLeft="-566px";
      sharebox.style.top="20px";
      sharebox.style.width="90px";
      document.getElementById('verticalbuttons').style.display='block';
      document.getElementById('horizontalbuttons').style.display='none';
    }
  };

  window.onresize = function(){
     if(timeOut != null) clearTimeout(timeOut);
     setTimeout(shiftButtons, 1000);
  };
</script>

<div id="sharebox" style="position: fixed; left: 50%; top: 20px; margin-left: -566px;">
  <div id="horizontalbuttons" style="display:none">
    <span class="st_fblike_hcount" displayText="ShareThis"></span>
    <span class="st_twitter_hcount" displayText="ShareThis"></span>
    <span class="st_sharethis_button" displayText="ShareThis"></span>
    <span class="st_email_button" displayText="Email"></span>
  </div>
  <div id="verticalbuttons">
    <span class="st_fblike_vcount" displayText="ShareThis"></span><br/>
    <span class="st_twitter_vcount" displayText="ShareThis"></span><br/>
    <span class="st_sharethis_vcount" displayText="ShareThis"></span><br/>
    <span class="st_email_button" displayText="Email"></span><br/>
  </div>
</div>

Prima:

<iframe id="sc-widget" src="https://w.soundcloud.com/player/?url=http://api.soundcloud.com/users/USER-ID/favorites" width="100%" height="465" scrolling="no" frameborder="no"></iframe>
    <script src="https://w.soundcloud.com/player/api.js" type="text/javascript"></script>
    <script type="text/javascript">
        (function(){
            var widgetIframe = document.getElementById('sc-widget'),
                    widget       = SC.Widget(widgetIframe);
            widget.bind(SC.Widget.Events.READY, function() {
                widget.bind(SC.Widget.Events.PLAY, function() {
                    // get information about currently playing sound
                    widget.getCurrentSound(function(currentSound) {
                        console.log('sound ' + currentSound.get('') + 'began to play');
                    });
                });
                // get current level of volume
                widget.getVolume(function(volume) {
                    console.log('current volume value is ' + volume);
                });
                // set new volume level
                widget.setVolume(50);
                // get the value of the current position
            });
        }());
    </script>

Dopo:

<iframe class="_iub_cs_activate" id="sc-widget" src="http://cdn.iubenda.com/cookie_solution/empty.html" suppressedsrc="https://w.soundcloud.com/player/?url=http://api.soundcloud.com/users/USER-ID/favorites" width="100%" height="465" scrolling="no" frameborder="no"></iframe>
    <script class="_iub_cs_activate" type="text/plain">
        var script = document.createElement("script"), tag = document.getElementsByTagName("script")[0];
        script.type = "text/javascript";
        if(script.readyState) {  //IE
            script.onreadystatechange = function() {
              if ( script.readyState === "loaded" || script.readyState === "complete" ) {
                script.onreadystatechange = null;
                    callback();
              }
            };
        } else {  //Others
            script.onload = function() {
              callback();
            };
        }
        script.src = "https://w.soundcloud.com/player/api.js"
        tag.parentNode.insertBefore(script, tag);
        function callback(){
            var widgetIframe = document.getElementById('sc-widget'),
                    widget = SC.Widget(widgetIframe);

            widget.bind(SC.Widget.Events.READY, function() {
                widget.bind(SC.Widget.Events.PLAY, function() {
                    // get information about currently playing sound
                    widget.getCurrentSound(function(currentSound) {
                        console.log('sound ' + currentSound.get('') + 'began to play');
                    });
                });
                // get current level of volume
                widget.getVolume(function(volume) {
                    console.log('current volume value is ' + volume);
                });
                // set new volume level
                widget.setVolume(50);
                // get the value of the current position
            });
        }
    </script>
Listen

Prima:

    <iframe src="https://embed.spotify.com/?uri=spotify:track:4th1RQAelzqgY7wL53UGQt" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>

Dopo:

    <iframe class="_iub_cs_activate" src="http://cdn.iubenda.com/cookie_solution/empty.html" suppressedsrc="https://embed.spotify.com/?uri=spotify:track:4th1RQAelzqgY7wL53UGQt" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>
Follow

Prima:

<iframe src="https://embed.spotify.com/follow/1/?uri=spotify:artist:1vCWHaC5f2uS3yhpwWbIA6&size=detail&theme=light" width="300" height="56" scrolling="no" frameborder="0" style="border:none; overflow:hidden;" allowtransparency="true"></iframe>

Dopo:

<iframe class="_iub_cs_activate" src="http://cdn.iubenda.com/cookie_solution/empty.html" suppressedsrc="https://embed.spotify.com/follow/1/?uri=spotify:artist:1vCWHaC5f2uS3yhpwWbIA6&size=detail&theme=light" width="300" height="56" scrolling="no" frameborder="0" style="border:none; overflow:hidden;" allowtransparency="true"></iframe>

Prima (sincrono):

<script src="//storify.com/YOURSITE/YOUR-LINK-TO-JS.js"></script>

Dopo (sincrono):

<script type="text/plain" class="_iub_cs_activate">
        (function() {
        var dsq = document.createElement('script');
        dsq.type = 'text/javascript';
        dsq.async = true;
        dsq.src = '//storify.com/YOURSITE/YOUR-LINK-TO-JS.js';
        (document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
</script>

Prima:

<form action="" method="POST">
     <script
          src="https://checkout.stripe.com/checkout.js" class="stripe-button"
          data-key="pk_test_6pRNASCoBOKtIshFeQd4XMUh"
          data-amount="2000"
          data-name="Demo Site"
          data-description="2 widgets ($20.00)"
          data-image="/128x128.png">
      </script>
</form>

Dopo:

<form action="" method="POST">
      <script
          src="https://checkout.stripe.com/checkout.js" class="stripe-button _iub_cs_activate"
          type="text/plain"
          data-key="pk_test_6pRNASCoBOKtIshFeQd4XMUh"
          data-amount="2000"
          data-name="Demo Site"
          data-description="2 widgets ($20.00)"
          data-image="/128x128.png">
      </script>
</form>

Prima:

<script async type="text/javascript">
    
    (function(){
        var d = document, wid = 'tt-' + parseInt(Math.random() * 9999999).toString(16), se = d.getElementsByTagName('script'), se_f = se[0], se_l = se[se.length - 1], tt = d.createElement('script'), w = d.createElement('div');
        w.id = wid; se_l.parentNode.insertBefore(w, se_l); tt.type = 'text/javascript', tt.async = true, tt.src = 'http://rotator.tradetracker.net/?r=YOUR-CODE&t=js&wid=' + wid; se_f.parentNode.insertBefore(tt, se_f);
    })();
    
 </script>

Dopo:

<script async type="text/plain" class="_iub_cs_activate">
    (function(){
        var d = document, wid = 'tt-' + parseInt(Math.random() * 9999999).toString(16), se = d.getElementsByTagName('script'), se_f = se[0], se_l = se[se.length - 1], tt = d.createElement('script'), w = d.createElement('div');
        w.id = wid; se_l.parentNode.insertBefore(w, se_l); tt.type = 'text/javascript', tt.async = true, tt.src = 'http://rotator.tradetracker.net/?r=YOUR-CODE&t=js&wid=' + wid; se_f.parentNode.insertBefore(tt, se_f);
    })();
 </script>
Badge Widget

Prima:

<div id="DIV-ID" class="CLASS-DIV">
  <ul id="UL-ID" class="CLASS-UL">
    <li id="LI-ID" class="CLASS-LI">
      <a target="_blank" href="http://www.tripadvisor.co.uk/"><img src="http://www.tripadvisor.co.uk/img/cdsi/partner/tripadvisor_logo_DIMENSIONS.png" alt="TripAdvisor"/></a>
    </li>
  </ul>
</div>
<script src="http://www.jscache.com/wejs?wtype=TYPE&amp;uniq=UNIQ&amp;locationId=LocationId&amp;icon=knifeAndFork&amp;lang=en_UK&amp;display_version=2"></script>

Dopo:

1. Aggiungi alla configurazione base di iubenda l’opzione reloadOnConsent:

<script>
  _iub.csConfiguration ? _iub.csConfiguration : _iub.csConfiguration = {}
  _iub.csConfiguration.reloadOnConsent = true;
</script>
//insert it into <head> tag after iubenda configuration

2. Definisci isConsentGiven per controllare i cookie:

<script type='text/javascript'>
      function isConsentGiven() {
          if('consentIsGiven' in window && (consentIsGiven === true || consentIsGiven === false)) return consentIsGiven;
          if(!('_iub' in window && 'csConfiguration' in _iub)) return false;
          var siteId = _iub.csConfiguration.siteId || '';
          var cookiePolicyId = _iub.csConfiguration.cookiePolicyId || '';
          var cs = document.cookie.split(';');
          var consentIsGiven = false;
          for (var i = 0; i < cs.length; i++) {
              while (cs[i].charAt(0) == ' ') cs[i] = cs[i].substring(1);
              if(cs[i].indexOf('_iub_cs-s'+ siteId) == 0||cs[i].indexOf('_iub_cs-'+ cookiePolicyId) == 0) {
                  consentIsGiven = true;
                  break;
              }
          }
          window.consentIsGiven = consentIsGiven;
          return consentIsGiven;
      }
    </script>

3. Sostituisci lo script originale di TripAdvisor con questo:

<script>
      if(isConsentGiven()){ //per ogni elemento di TripAdvisor
        document.write('<div id="DIV-ID" class="CLASS-DIV"><ul id="UL-ID" class="CLASS-UL"><li id="LI-ID" class="CLASS-LI"><a target="_blank" href="http://www.tripadvisor.co.uk/"><img src="http://www.tripadvisor.co.uk/img/cdsi/partner/tripadvisor_logo_DIMENSIONS.png" alt="TripAdvisor"\/><\/a><\/li><\/ul><\/div>');
        document.write('<script src="http://www.jscache.com/wejs?wtype=TYPE&amp;uniq=UNIQ&amp;locationId=LocationId&amp;icon=knifeAndFork&amp;lang=en_UK&amp;display_version=2"><\/script>');
      }
    </script>
Read Review Widget

Prima:

<div id="DIV-ID" class="CLASS-DIV">
  <ul id="UL-ID" class="CLASS-UL">
    <li id="LI-ID" class="CLASS-LI">
      <a target="_blank" href="http://www.tripadvisor.co.uk/"><img src="http://www.tripadvisor.co.uk/img/cdsi/partner/tripadvisor_logo_DIMENSIONS.png" alt="TripAdvisor"/></a>
    </li>
  </ul>
</div>
<script src="http://www.jscache.com/wejs?wtype=TYPE&amp;uniq=UNIQ&amp;locationId=LocationId&amp;icon=knifeAndFork&amp;lang=en_UK&amp;display_version=2"></script>

Dopo:

1. Aggiungi alla configurazione base di iubenda l’opzione reloadOnConsent:

<script>
  _iub.csConfiguration ? _iub.csConfiguration : _iub.csConfiguration = {}
  _iub.csConfiguration.reloadOnConsent = true;
</script>
//insert it into <head> tag after iubenda configuration

2. Definisci isConsentGiven per controllare i cookie:

<script type='text/javascript'>
      function isConsentGiven() {
          if('consentIsGiven' in window && (consentIsGiven === true || consentIsGiven === false)) return consentIsGiven;
          if(!('_iub' in window && 'csConfiguration' in _iub)) return false;
          var siteId = _iub.csConfiguration.siteId || '';
          var cookiePolicyId = _iub.csConfiguration.cookiePolicyId || '';
          var cs = document.cookie.split(';');
          var consentIsGiven = false;
          for (var i = 0; i < cs.length; i++) {
              while (cs[i].charAt(0) == ' ') cs[i] = cs[i].substring(1);
              if(cs[i].indexOf('_iub_cs-s'+ siteId) == 0||cs[i].indexOf('_iub_cs-'+ cookiePolicyId) == 0) {
                  consentIsGiven = true;
                  break;
              }
          }
          window.consentIsGiven = consentIsGiven;
          return consentIsGiven;
      }
    </script>

3. Sostituisci lo script originale di TripAdvisor con questo:

<script>
      if(isConsentGiven()){ //per ogni elemento di TripAdvisor
        document.write('<div id="DIV-ID" class="CLASS-DIV"><ul id="UL-ID" class="CLASS-UL"><li id="LI-ID" class="CLASS-LI"><a target="_blank" href="http://www.tripadvisor.co.uk/"><img src="http://www.tripadvisor.co.uk/img/cdsi/partner/tripadvisor_logo_DIMENSIONS.png" alt="TripAdvisor"\/><\/a><\/li><\/ul><\/div>');
        document.write('<script src="http://www.jscache.com/wejs?wtype=TYPE&amp;uniq=UNIQ&amp;locationId=LocationId&amp;icon=knifeAndFork&amp;lang=en_UK&amp;display_version=2"><\/script>');
      }
    </script>
Write Review Widget

Prima:

<div id="DIV-ID" class="CLASS-DIV">
  <ul id="UL-ID" class="CLASS-UL">
    <li id="LI-ID" class="CLASS-LI">
      <a target="_blank" href="http://www.tripadvisor.co.uk/"><img src="http://www.tripadvisor.co.uk/img/cdsi/partner/tripadvisor_logo_DIMENSIONS.png" alt="TripAdvisor"/></a>
    </li>
  </ul>
</div>
<script src="http://www.jscache.com/wejs?wtype=TYPE&amp;uniq=UNIQ&amp;locationId=LocationId&amp;icon=knifeAndFork&amp;lang=en_UK&amp;display_version=2"></script>

Dopo:

1. Aggiungi alla configurazione base di iubenda l’opzione reloadOnConsent:

<script>
  _iub.csConfiguration ? _iub.csConfiguration : _iub.csConfiguration = {}
  _iub.csConfiguration.reloadOnConsent = true;
</script>
//insert it into <head> tag after iubenda configuration

2. Definisci isConsentGiven per controllare i cookie:

<script type='text/javascript'>
      function isConsentGiven() {
          if('consentIsGiven' in window && (consentIsGiven === true || consentIsGiven === false)) return consentIsGiven;
          if(!('_iub' in window && 'csConfiguration' in _iub)) return false;
          var siteId = _iub.csConfiguration.siteId || '';
          var cookiePolicyId = _iub.csConfiguration.cookiePolicyId || '';
          var cs = document.cookie.split(';');
          var consentIsGiven = false;
          for (var i = 0; i < cs.length; i++) {
              while (cs[i].charAt(0) == ' ') cs[i] = cs[i].substring(1);
              if(cs[i].indexOf('_iub_cs-s'+ siteId) == 0||cs[i].indexOf('_iub_cs-'+ cookiePolicyId) == 0) {
                  consentIsGiven = true;
                  break;
              }
          }
          window.consentIsGiven = consentIsGiven;
          return consentIsGiven;
      }
    </script>

3. Sostituisci lo script originale di TripAdvisor con questo:

<script>
        if(isConsentGiven()){
            document.write('<div id="DIV-ID" class="CLASS-DIV"><ul id="UL-ID" class="CLASS-UL"><li id="LI-ID" class="CLASS-LI"><a target="_blank" href="http://www.tripadvisor.co.uk/"><img class="_iub_cs_activate" src="data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+" suppressedsrc="http://www.tripadvisor.co.uk/img/cdsi/img2/branding/150_logo-11900-2.png" alt="TripAdvisor"\/><\/a><\/li><\/ul><\/div>');
            document.write('<script src="http://www.jscache.com/wejs?wtype=cdswritereviewlg&amp;uniq=YOUR-UNIQ&amp;locationId=YOUR-LOCATION&amp;lang=en_UK&amp;border=false&amp;langversion=2"><\/script>');
        }
    </script>
Pulsante Follow

Prima:

<a class="twitter-follow-button "
   href="https://twitter.com/twitter"
   data-show-count="false"
   data-size="large">
  Follow @twitter
</a>
<script>
window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);t._e=[  ];t.ready=function(f){t._e.push(f);};return     t;}(document,"script","twitter-wjs"));
</script>

Dopo:

<a class="twitter-follow-button "
   href="https://twitter.com/twitter"
   data-show-count="false"
   data-size="large">
  Follow @twitter
</a>
<script type="text/plain" class="_iub_cs_activate">
window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,"script","twitter-wjs"));
</script>
Mention

Prima:

<a href="https://twitter.com/intent/tweet?screen_name=USERNAME" class="twitter-mention-button" data-related="USERNAME">Tweet to @USERNAME</a>
<script>
function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

Dopo:

<a class="twitter-timeline" href="https://twitter.com/USERNAME" data-widget-id="000000000000000000">
Tweet di @USERNAME
</a>
<script type="text/plain" class="_iub_cs_activate">
function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
</script>
Pulsante Tweet

Prima:

<a class="twitter-share-button"
   href="https://twitter.com/share">
  Tweet
</a>
<script>
    window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,"script","twitter-wjs"));
</script>

Dopo:

<a class="twitter-share-button"
   href="https://twitter.com/share">
  Tweet
</a>
<script type="text/plain" class="_iub_cs_activate">
    window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,"script","twitter-wjs"));
</script>
Timeline

Prima:

<a class="twitter-timeline" href="https://twitter.com/USERNAME" data-widget-id="000000000000000000">
Tweet di @USERNAME
</a>
<script>
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

Dopo:

<a class="twitter-timeline" href="https://twitter.com/USERNAME" data-widget-id="000000000000000000">
Tweet di @USERNAME
</a>
<script type="text/plain" class="_iub_cs_activate">
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
</script>

Prima:

<script type="text/javascript">
        // Include the UserVoice JavaScript SDK (only needed once on a page)
        UserVoice=window.UserVoice||[];
        (function(){
            var uv=document.createElement('script');
            uv.type='text/javascript';
            uv.async=true;
            uv.src='//widget.uservoice.com/YOUR_KEY.js';
            var s=document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(uv,s)
        })();

        //
        // UserVoice Javascript SDK developer documentation:
        // https://www.uservoice.com/o/javascript-sdk
        //

        // Set colors
        UserVoice.push(['set', {
            accent_color: '#448dd6',
            trigger_color: 'white',
            trigger_background_color: 'rgba(46, 49, 51, 0.6)'
        }]);

        // Identify the user and pass traits
        // To enable, replace sample data with actual user traits and uncomment the line
        UserVoice.push(['identify', {
            //email:      'john.doe@example.com', // User’s email address
            //name:       'John Doe', // User’s real name
            //created_at: 1364406966, // Unix timestamp for the date the user signed up
            //id:         123, // Optional: Unique id of the user (if set, this should not change)
            //type:       'Owner', // Optional: segment your users by type
            //account: {
            //  id:           123, // Optional: associate multiple users with a single account
            //  name:         'Acme, Co.', // Account name
            //  created_at:   1364406966, // Unix timestamp for the date the account was created
            //  monthly_rate: 9.99, // Decimal; monthly rate of the account
            //  ltv:          1495.00, // Decimal; lifetime value of the account
            //  plan:         'Enhanced' // Plan name for the account
            //}
        }]);

        // Add default trigger to the bottom-right corner of the window:
        UserVoice.push(['addTrigger', {mode: 'smartvote', trigger_position: 'bottom-right' }]);

        // Or, use your own custom trigger:
        //UserVoice.push(['addTrigger', '#id', { mode: 'smartvote' }]);

        // Autoprompt for Satisfaction and SmartVote (only displayed under certain conditions)
        UserVoice.push(['autoprompt', {}]);
    </script>

Dopo:

 <script type="text/plain" class="_iub_cs_activate">
        // Include the UserVoice JavaScript SDK (only needed once on a page)
        UserVoice=window.UserVoice||[];
        (function(){
            var uv=document.createElement('script');
            uv.type='text/javascript';
            uv.async=true;
            uv.src='//widget.uservoice.com/YOUR_KEY.js';
            var s=document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(uv,s)
        })();

        //
        // UserVoice Javascript SDK developer documentation:
        // https://www.uservoice.com/o/javascript-sdk
        //

        // Set colors
        UserVoice.push(['set', {
            accent_color: '#448dd6',
            trigger_color: 'white',
            trigger_background_color: 'rgba(46, 49, 51, 0.6)'
        }]);

        // Identify the user and pass traits
        // To enable, replace sample data with actual user traits and uncomment the line
        UserVoice.push(['identify', {
            //email:      'john.doe@example.com', // User’s email address
            //name:       'John Doe', // User’s real name
            //created_at: 1364406966, // Unix timestamp for the date the user signed up
            //id:         123, // Optional: Unique id of the user (if set, this should not change)
            //type:       'Owner', // Optional: segment your users by type
            //account: {
            //  id:           123, // Optional: associate multiple users with a single account
            //  name:         'Acme, Co.', // Account name
            //  created_at:   1364406966, // Unix timestamp for the date the account was created
            //  monthly_rate: 9.99, // Decimal; monthly rate of the account
            //  ltv:          1495.00, // Decimal; lifetime value of the account
            //  plan:         'Enhanced' // Plan name for the account
            //}
        }]);

        // Add default trigger to the bottom-right corner of the window:
        UserVoice.push(['addTrigger', {mode: 'smartvote', trigger_position: 'bottom-right' }]);

        // Or, use your own custom trigger:
        //UserVoice.push(['addTrigger', '#id', { mode: 'smartvote' }]);

        // Autoprompt for Satisfaction and SmartVote (only displayed under certain conditions)
        UserVoice.push(['autoprompt', {}]);
    </script>

Prima:

<iframe src="//player.vimeo.com/video/VIDEOID" width="width" height="height" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

Dopo:

<iframe class="_iub_cs_activate" src="data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+" suppressedsrc="//player.vimeo.com/video/video-id" width="width" height="height" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

Prima:

<script type="text/javascript" src="https://ads.viralize.tv/display/?wid=demo&amp;preview=1&amp;f=iframe&amp;cid=CID" data-wid="demo" ></script>

Dopo:

<script type="text/plain" class="_iub_cs_activate" src="https://ads.viralize.tv/display/?wid=demo&amp;preview=1&amp;f=iframe&amp;cid=CID" data-wid="demo"></script>

Quanto segue si applica unicamente nei casi in cui non si utilizzi l’opzione di YouTube che permette di includere video senza installare cookie.

Player

Prima:

<div id="player"></div>
<script type="text/javascript">
    var tag = document.createElement('script');
    tag.src = "https://www.youtube.com/iframe_api";
    var firstScriptTag = document.getElementsByTagName('script')[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
    var player;
    function onYouTubeIframeAPIReady() {
        player = new YT.Player('player', {
            height: 'XXX',
            width: 'XXX',
            videoId: '00000000-00',
            events: {
                'onReady': onPlayerReady,
                'onStateChange': onPlayerStateChange
            }
        });
    }
    function onPlayerReady(event) {
        event.target.playVideo();
    }
    var done = false;
    function onPlayerStateChange(event) {
        if (event.data == YT.PlayerState.PLAYING && !done)            {
            setTimeout(stopVideo, 6000);
            done = true;
        }
    }
    function stopVideo() {
        player.stopVideo();
    }
</script>

Dopo:

<div id="player"></div>
<script type="text/plain" class="_iub_cs_activate">
    var tag = document.createElement('script');
    tag.src = "https://www.youtube.com/iframe_api";
    var firstScriptTag = document.getElementsByTagName('script')[0];
    firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
    var player;
    function onYouTubeIframeAPIReady() {
        player = new YT.Player('player', {
            height: 'XXX',
            width: 'XXX',
            videoId: '00000000-00',
            events: {
                'onReady': onPlayerReady,
                'onStateChange': onPlayerStateChange
            }
        });
    }
    function onPlayerReady(event) {
        event.target.playVideo();
    }
    var done = false;
    function onPlayerStateChange(event) {
        if (event.data == YT.PlayerState.PLAYING && !done)            {
            setTimeout(stopVideo, 6000);
            done = true;
        }
    }
    function stopVideo() {
        player.stopVideo();
    }
</script>
Player iframe

Prima:

<iframe id="player" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/M7lc1UVf-VE?enablejsapi=1&origin=http://example.com" frameborder="0">
</iframe>

Dopo:

<div id="myIframe"></div>
<script type="text/html" class="_iub_cs_activate">
     document.getElementById('myIframe').innerHTML = '<iframe id="player" type="text/plain" width="640" height="390" src="http://www.youtube.com/embed/M7lc1UVf-VE?enablejsapi=1&origin=http://example.com" frameborder="0"></iframe>';    
</script>
Player iframe (nuova versione)

Prima:

<iframe id="player" type="text/html" src="http://www.youtube.com/embed/VIDEO-ID?enablejsapi=1&origin=http://example.com" frameborder="0" width="width" height="height" ></iframe>

Dopo:

<iframe id="player" type="text/plain" class="_iub_cs_activate" src="data:text/html;base64,PGh0bWw+PGJvZHk+U3VwcHJlc3NlZDwvYm9keT48L2h0bWw+" suppressedsrc="http://www.youtube.com/embed/VIDEO-ID?enablejsapi=1&origin=http://example.com" frameborder="0" width="width" height="height"></iframe>

Still have questions?

Visit our support forum Email us