[Resolved] Code from Quantcast for Cookies

Home Forums Support [Resolved] Code from Quantcast for Cookies

Home Forums Support Code from Quantcast for Cookies

  • This topic has 5 replies, 2 voices, and was last updated 4 years ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1190531
    rafel jesus

    Hi there.
    I have a code generate from the website Quantcast.com, but I don’t know like introduced in the web site, with elements or with copy and past in style.css.
    Thanks for your help.
    Best regartds.

    #1190593
    David
    Staff
    Customer Support

    Hi there,

    can you share a link to the code ? Or copy and paste it hear then we can advise where it should go.

    #1190906
    rafel jesus

    Hi David.
    Of course.

    <!-- 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': 'es',
    		'Initial Screen Title Text': 'Tu privacidad es importante para nosotros',
    		'Initial Screen Reject Button Text': 'NO ACEPTO',
    		'Initial Screen Accept Button Text': 'ACEPTO',
    		'Initial Screen Purpose Link Text': 'Mostrar objetivos',
    		'Purpose Screen Title Text': 'Tu privacidad es importante para nosotros',
    		'Purpose Screen Body Text': 'Puede establecer sus preferencias de consentimiento y determinar cómo desea que se utilicen sus datos según los fines que se detallan a continuación. Puede establecer sus preferencias con respecto a nosotros independientemente de las de los socios externos. Cada objetivo tiene una descripción para que sepa cómo nosotros y los socios usamos sus datos.',
    		'Purpose Screen Vendor Link Text': 'Visualizza i fornitori',
    		'Purpose Screen Cancel Button Text': 'Cancelar',
    		'Purpose Screen Save and Exit Button Text': 'Guardar y salir',
    		'Vendor Screen Title Text': 'Tu privacidad es importante para nosotros',
    		'Vendor Screen Body Text': 'Puede configurar las preferencias de consentimiento para los terceros externos individuales con los que trabajamos a continuación. Expanda cada elemento de la lista de la compañía para ver para qué fines usan los datos para ayudarlo a tomar sus decisiones. En algunos casos, las compañías pueden usar sus datos sin pedir su consentimiento en función de sus intereses legítimos. Puede hacer clic en los enlaces de sus políticas de privacidad para obtener más información y para objetar dicho procesamiento.',
    		'Vendor Screen Accept All Button Text': 'ACEPTAR TODO',
    		'Vendor Screen Reject All Button Text': 'RECHAZAR TODO',
    		'Vendor Screen Purposes Link Text': 'Volver a los propósitos',
    		'Vendor Screen Cancel Button Text': 'Cancelar',
    		'Vendor Screen Save and Exit Button Text': 'Guardar y salir',
    		'Initial Screen Body Text': 'Nosotros y nuestros socios utilizamos tecnologías, como las cookies, y procesamos datos personales, como las direcciones IP y los identificadores de cookies, para personalizar los anuncios y el contenido según sus intereses, medir el rendimiento de los anuncios y el contenido y obtener información sobre las audiencias que vieron los anuncios y el contenido. Haga clic a continuación para autorizar el uso de esta tecnología y el procesamiento de sus datos personales para estos fines. Puede cambiar de opinión y cambiar sus opciones de consentimiento en cualquier momento al regresar a este sitio.',
    		'Initial Screen Body Text Option': 1,
    		'Min Days Between UI Displays': 366,
    		'Publisher Purpose IDs': [1,2,3,4,5],
    		'Publisher Name': 'Hiostal Montsec',
    		'Post Consent Page': 'https://www.hostalmontsec.cat/',
    		'Consent Scope': 'service',
        });
    </script>
    <!-- End Quantcast Choice. Consent Manager Tag -->
        <style>
            .qc-cmp-button {
              background-color: #1abc9c !important;
              border-color: #1abc9c !important;
            }
            .qc-cmp-button:hover {
              background-color: transparent !important;
              border-color: #1abc9c !important;
            }
            .qc-cmp-alt-action,
            .qc-cmp-link {
              color: #1abc9c !important;
            }
            .qc-cmp-button.qc-cmp-secondary-button:hover
             {
              border-color: transparent !important;
              background-color: #1abc9c !important;
            }
            .qc-cmp-button.qc-cmp-secondary-button {
              border-color: #eee !important;
              background-color: #eee !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: #33331F !important;
            }
            .qc-cmp-ui a,
            .qc-cmp-ui .qc-cmp-alt-action,
            .qc-cmp-toggle-status  {
              color: #FF0000 !important;
            }
        </style>
    #1190908
    David
    Staff
    Customer Support

    Use a Hook Element:

    https://docs.generatepress.com/article/hooks-element-overview/

    And select the WP_Footer hook

    #1190925
    rafel jesus

    Hi David.
    It’s working.
    Thanks a lot.
    Best regards.

    #1191002
    David
    Staff
    Customer Support

    You’re welcome

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.