templates/includes/common/js-rgpd-tarte-au-citron.html.twig line 1

Open in your IDE?
  1. {% if app.environment == 'prod' %}
  2. {% if tarte_au_citron_token is defined and tarte_au_citron_token is not empty %}
  3. <script type="text/javascript" src="https://tarteaucitron.io/load.js?domain={{ app.request.schemeAndHttpHost|replace({'https://': ''}) }}&uuid={{ tarte_au_citron_token }}"></script>
  4. {% endif %}
  5. <!-- ajout manuel des autres services pour injection dans le panneau RGPD tarte au citron-->
  6. <script type="text/javascript">
  7. {% if mixpanel_token is defined and mixpanel_token is not empty %}
  8. tarteaucitron.services.mixpanelrgpd = {
  9. "key": "mixpanelrgpd",
  10. "type": "analytic",
  11. "name": "mixpanel",
  12. "needConsent": true,
  13. "cookies": ['mp_{{ mixpanel_token }}_mixpanel'],
  14. "readmoreLink": "https://mixpanel.com/legal/gdpr-faq/",
  15. "js": function () {
  16. "use strict";
  17. // When user allow cookie
  18. // lib mixpanel
  19. (function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments, 0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
  20. for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
  21. mixpanel.init("{{ mixpanel_token }}");
  22. }
  23. };
  24. (tarteaucitron.job = tarteaucitron.job || []).push('mixpanelrgpd');
  25. {% endif %}
  26. {% if weborama_tag is defined and weborama_tag %}
  27. tarteaucitron.services.weboramargpd = {
  28. "key": "weboramargpd",
  29. "type": "analytic",
  30. "name": "weborama",
  31. "needConsent": true,
  32. "cookies": ['AFFICHE_W'],
  33. "readmoreLink": "https://weborama.com/confidentialite/",
  34. "js": function () {
  35. "use strict";
  36. // When user allow cookie
  37. }
  38. };
  39. (tarteaucitron.job = tarteaucitron.job || []).push('weboramargpd');
  40. {% endif %}
  41. </script>
  42. {% endif %}