telkomp Posted October 2, 2019 Share Posted October 2, 2019 Hello. I want to put in my PrestaShop GDPR information box from Quantcast. Installation is very easy - You only need to generate javascript code on Quantcast website and paste it into Your website. I did that, I pasted code into file \themes\classic\templates\_partials\header.tpl and reloaded cache. The result is HTTP error 500. After replacing Quantcast code with just "hello world" in header.tpl there is no error, just "hello world" text displayed in the beginning of website. Conclusions? There is no problem with editing header.tpl and putting there custom code, but there is some problem between PrestaShop and Quantcast code. Someone can help? I am pasting Quantcast code below. <!-- 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': 'pl', 'Initial Screen Title Text': 'Szanujemy Twoją prywatność', 'Initial Screen Reject Button Text': 'NIE AKCEPTUJĘ', 'Initial Screen Accept Button Text': 'AKCEPTUJĘ', 'Initial Screen Purpose Link Text': 'Pokaż cele', 'Purpose Screen Title Text': 'Szanujemy Twoją prywatność', 'Purpose Screen Body Text': 'Możesz ustawić preferencje dotyczące zgody i określić, w jaki sposób chcesz, aby Twoje dane były używane w oparciu o poniższe cele. Możesz ustawić swoje preferencje dla nas niezależnie od preferencji partnerów zewnętrznych. Każdy cel zawiera opis, dzięki któremu wiesz, jak my i partnerzy korzystamy z Twoich danych.', 'Purpose Screen Vendor Link Text': 'Zobacz dostawców', 'Purpose Screen Cancel Button Text': 'Anuluj', 'Purpose Screen Save and Exit Button Text': 'Zapisz i zamknij', 'Vendor Screen Title Text': 'Szanujemy Twoją prywatność', 'Vendor Screen Body Text': 'Możesz ustawić preferencje zgody dla poszczególnych partnerów zewnętrznych, z którymi współpracujemy poniżej. Rozwiń każdy element listy firm, aby sprawdzić, do jakich celów wykorzystują dane, aby pomóc w dokonaniu wyboru. W niektórych przypadkach firmy mogą wykorzystywać dane użytkownika bez pytania o zgodę w oparciu o ich uzasadnione interesy. Możesz kliknąć ich linki polityki prywatności, aby uzyskać więcej informacji i sprzeciwić się takiemu przetwarzaniu.', 'Vendor Screen Accept All Button Text': 'AKCEPTUJ WSZYSTKIE', 'Vendor Screen Reject All Button Text': 'ODRZUĆ WSZYSTKIE', 'Vendor Screen Purposes Link Text': 'Powrót do celów', 'Vendor Screen Cancel Button Text': 'Anuluj', 'Vendor Screen Save and Exit Button Text': 'Zapisz i zamknij', 'Initial Screen Body Text': 'My i nasi partnerzy wykorzystujemy technologie, takie jak pliki cookie, i przetwarzamy dane osobowe, takie jak adresy IP i identyfikatory plików cookie, w celu spersonalizowania reklam i treści w oparciu o Twoje zainteresowania, mierzenia wydajności reklam i treści oraz uzyskiwania wglądu w odbiorców, którzy widzieli reklamy i treści. Kliknij poniżej, aby wyrazić zgodę na wykorzystanie tej technologii i przetwarzanie danych osobowych w tych celach. Możesz zmienić zdanie i zmienić wybór zgody w dowolnym momencie, wracając na tę stronę.', 'Initial Screen Body Text Option': 1, 'Publisher Name': 'Ryś Optyka', 'Publisher Purpose IDs': [1,2,3,4,5], 'Consent Scope': 'service', 'UI Layout': 'banner', }); </script> <!-- End Quantcast Choice. Consent Manager Tag --> <style> .qc-cmp-button.qc-cmp-secondary-button { border-color: #eee !important; background-color: #eee !important; } </style> Link to comment Share on other sites More sharing options...
Jim_C Posted April 20, 2020 Share Posted April 20, 2020 Hello Telkomp. Did you find a solution ? I saw on Quantcast's website that it needs to beput on the Footer.Tpl which I did but their robot doesn't detect it. Any hints welcomed. Thanks. Link to comment Share on other sites More sharing options...
Guest Posted April 20, 2020 Share Posted April 20, 2020 (edited) . Edited July 26, 2021 by Guest (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted April 20, 2020 Share Posted April 20, 2020 (edited) . Edited July 26, 2021 by Guest (see edit history) Link to comment Share on other sites More sharing options...
Jim_C Posted April 21, 2020 Share Posted April 21, 2020 (edited) Hi D.Tengler, Thank you very much for your kind advice. Unfortunately it did not work, I'm using Prestashop version 1.7.6.1. I will check alternative solution Quantcast also advise via Google Tag Manager and update this thread if solution is found through that channel. Edited April 21, 2020 by Jim_C Pressed Save button too early before completing my post. (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted April 21, 2020 Share Posted April 21, 2020 (edited) . Edited July 26, 2021 by Guest (see edit history) Link to comment Share on other sites More sharing options...
Jim_C Posted April 21, 2020 Share Posted April 21, 2020 Do you use a Content Managment tool for PS 1.7 that shows the Popup asking for Consent ? Link to comment Share on other sites More sharing options...
Guest Posted April 21, 2020 Share Posted April 21, 2020 (edited) . Edited July 26, 2021 by Guest (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now