Hello Guys
As European site with European Advertising vendors, i need to implement on my wordpress site a GDPR consent with IAB certification.
Most of the sites are using Quantcast Choice. I have a code to implement:
<!– Quantcast Choice. Consent Manager Tag –>
<script type=”text/javascript” async=true>
var elem = document.createElement(‘script’);
elem.src = ‘https://quantcast.mgr.consensu.org/cmp.js’;
elem.async = true;
elem.type = “text/javascript”;
var scpt = document.getElementsByTagName(‘script’)[0];
scpt.parentNode.insertBefore(elem, scpt);
(function() {
var gdprAppliesGlobally = false;
function addFrame() {
if (!window.frames[‘__cmpLocator’]) {
if (document.body) {
var body = document.body,
iframe = document.createElement(‘iframe’);
iframe.style = ‘display:none’;
iframe.name = ‘__cmpLocator’;
body.appendChild(iframe);
} else {
// In the case where this stub is located in the head,
// this allows us to inject the iframe more quickly than
// relying on DOMContentLoaded or other events.
setTimeout(addFrame, 5);
}
}
}
addFrame();
function cmpMsgHandler(event) {
var msgIsString = typeof event.data === “string”;
var json;
if(msgIsString) {
json = event.data.indexOf(“__cmpCall”) != -1 ? JSON.parse(event.data) : {};
} else {
json = event.data;
}
if (json.__cmpCall) {
var i = json.__cmpCall;
window.__cmp(i.command, i.parameter, function(retValue, success) {
var returnMsg = {“__cmpReturn”: {
“returnValue”: retValue,
“success”: success,
“callId”: i.callId
}};
event.source.postMessage(msgIsString ?
JSON.stringify(returnMsg) : returnMsg, ‘*’);
});
}
}
window.__cmp = function (c) {
var b = arguments;
if (!b.length) {
return __cmp.a;
}
else if (b[0] === ‘ping’) {
b[2]({“gdprAppliesGlobally”: gdprAppliesGlobally,
“cmpLoaded”: false}, true);
} else if (c == ‘__cmp’)
return false;
else {
if (typeof __cmp.a === ‘undefined’) {
__cmp.a = [];
}
__cmp.a.push([].slice.apply(b));
}
}
window.__cmp.gdprAppliesGlobally = gdprAppliesGlobally;
window.__cmp.msgHandler = cmpMsgHandler;
if (window.addEventListener) {
window.addEventListener(‘message’, cmpMsgHandler, false);
}
else {
window.attachEvent(‘onmessage’, cmpMsgHandler);
}
})();
window.__cmp(‘init’, {
‘Language’: ‘it’,
‘Initial Screen Title Text’: ‘Il rispetto della tua privacy è la nostra priorità’,
‘Initial Screen Reject Button Text’: ‘NON ACCETTO’,
‘Initial Screen Accept Button Text’: ‘ACCETTO’,
‘Initial Screen Purpose Link Text’: ‘Mostra finalità’,
‘Purpose Screen Title Text’: ‘Il rispetto della tua privacy è la nostra priorità’,
‘Purpose Screen Body Text’: ‘Di seguito puoi impostare le preferenze sul consenso e determinare come desideri utilizzare i dati in base alle finalità. Puoi impostare le tue preferenze per noi indipendentemente da quelle dei partner di terze parti. Ogni finalità ha una descrizione in modo che tu sappia come noi e i nostri partner utilizziamo i tuoi dati.’,
‘Purpose Screen Vendor Link Text’: ‘Visualizza i fornitori’,
‘Purpose Screen Cancel Button Text’: ‘Annullare’,
‘Purpose Screen Save and Exit Button Text’: ‘Salva ed Esci’,
‘Vendor Screen Title Text’: ‘Il rispetto della tua privacy è la nostra priorità’,
‘Vendor Screen Body Text’: ‘Di seguito puoi impostare le preferenze sul consenso per i singoli partner di terze parti con cui collaboriamo. Per visualizzare le finalità rispetto alle quali i singoli partner di terze parti usano i dati per agevolarti nelle tue scelte, espandi ogni voce dell'elenco di aziende. In alcuni casi, le aziende potrebbero utilizzare i tuoi dati senza chiedere il tuo consenso, in base ai loro legittimi interessi. Per ulteriori informazioni e per opporti a tale elaborazione, puoi fare clic sui rispettivi link alla policy sulla privacy.’,
‘Vendor Screen Accept All Button Text’: ‘ACCETTA TUTTO’,
‘Vendor Screen Reject All Button Text’: ‘RIFIUTA TUTTO’,
‘Vendor Screen Purposes Link Text’: ‘Torna alle finalità’,
‘Vendor Screen Cancel Button Text’: ‘Annullare’,
‘Vendor Screen Save and Exit Button Text’: ‘Salva ed Esci’,
‘Initial Screen Body Text’: ‘Noi e i nostri partner utilizziamo tecnologie, quali quelle dei cookie, ed elaboriamo i dati personali, quali gli indirizzi IP e gli identificatori dei cookie, per personalizzare gli annunci e i contenuti in base ai tuoi interessi, misurare le prestazioni di annunci e contenuti e ricavare informazioni sul pubblico che ha visualizzato gli annunci e i contenuti. Fai clic sotto per acconsentire all' utilizzo di questa tecnologia e al trattamento dei tuoi dati personali per queste finalità. Puoi cambiare idea e modificare le tue opzioni sul consenso in qualsiasi momento ritornando su questo sito.’,
‘Initial Screen Body Text Option’: 1,
‘Publisher Name’: ‘Rnbjunk Musica’,
‘Min Days Between UI Displays’: 15,
‘Publisher Purpose IDs’: [1,2,3,4,5],
});
</script>
<!– End Quantcast Choice. Consent Manager Tag –>
<style>
.qc-cmp-button {
background-color: #FFFFFF !important;
border-color: #FFFFFF !important;
}
.qc-cmp-button:hover {
background-color: transparent !important;
border-color: #FFFFFF !important;
}
.qc-cmp-alt-action,
.qc-cmp-link {
color: #FFFFFF !important;
}
.qc-cmp-button.qc-cmp-secondary-button:hover
{
border-color: transparent !important;
background-color: #FFFFFF !important;
}
.qc-cmp-button {
color: #6E61B0 !important;
}
.qc-cmp-button.qc-cmp-secondary-button {
color: #FFFFFF !important;
}
.qc-cmp-button.qc-cmp-button.qc-cmp-secondary-button:hover {
color:#ffffff !important;
}
.qc-cmp-button.qc-cmp-secondary-button {
border-color: #6E61B0 !important;
background-color: #6E61B0 !important;
}
.qc-cmp-ui,
.qc-cmp-ui .qc-cmp-main-messaging,
.qc-cmp-ui .qc-cmp-messaging,
.qc-cmp-ui .qc-cmp-beta-messaging,
.qc-cmp-ui .qc-cmp-title,
.qc-cmp-ui .qc-cmp-sub-title,
.qc-cmp-ui .qc-cmp-purpose-info,
.qc-cmp-ui .qc-cmp-table,
.qc-cmp-ui .qc-cmp-table-header,
.qc-cmp-ui .qc-cmp-vendor-list,
.qc-cmp-ui .qc-cmp-vendor-list-title {
color: #000000 !important;
}
.qc-cmp-ui a,
.qc-cmp-ui .qc-cmp-alt-action,
.qc-cmp-toggle-status {
color: #6E61B0 !important;
}
.qc-cmp-ui {
background-color: #FFFFFF !important;
}
.qc-cmp-publisher-purposes-table .qc-cmp-table-header {
background-color: #FFFFFF !important;
}
.qc-cmp-publisher-purposes-table .qc-cmp-table-row {
background-color: #FFFFFF !important;
}
.qc-cmp-vendor-list .qc-cmp-vendor-row {
background-color: #FFFFFF !important;
}
.qc-cmp-vendor-list .qc-cmp-vendor-row-header {
background-color: #FFFFFF !important;
}
.qc-cmp-table {
border: 1px solid #000000 !important;
}
.qc-cmp-table-row {
border-top: 1px solid #000000 !important;
}
.qc-cmp-vendor-list {
border: 1px solid #000000 !important;
}
.qc-cmp-vendor-row {
border-top: 1px solid #000000 !important;
}
.qc-cmp-arrow-down {
background: url(“data:image/svg+xml,%3Csvg xmlns=’http://www.w3.org/2000/svg’ viewBox=’0 0 16 16′ fill=’none’ stroke=’#000000′ stroke-width=’2′ stroke-linecap=’round’ stroke-linejoin=’round’%3E %3Cpolyline points=’2 5 8 11 14 5’/%3E %3C/svg%3E”) center no-repeat;
}
.qc-cmp-toggle-status {
color: #000000 !important;
}
.qc-cmp-table-header {
color: #000000;
}
</style>
I want it to be shown on Mobile theme and Desktop Theme, before any other Script.
I’ve put the code in here, but it doesn’t seems to work.

Can someone help us out?
Hello !
You can try and insert it manually in the header here: https://www.screencast.com/t/jcoaBqSJve1
Thank you !
