1( function($) { 2 var gaId = 'G-B7MMGG409G'; 3 var domain = window.location; 4 5 removeGA(gaId, domain); 6 7 var options = { 8 title: 'Ihre Datenschutzeinstellungen', 9 message: 'Unsere Website setzt Cookies ein. Einige der Cookies sind notwendig, während weitere optionale Cookies Ihre Nutzererfahrung steigern und die Website verbessern. ', 10 delay: 600, 11 expires: 1, 12 link: '/datenschutz#cookielaw', 13 onAccept: function(){ 14 var myPreferences = $.fn.ihavecookies.cookie(); 15 16 console.log(myPreferences); 17 18 if (myPreferences.indexOf('analytics') !== -1) { 19 setGA(gaId); 20 } 21 if (myPreferences.indexOf('analytics') === -1) { 22 removeGA(gaId, domain); 23 } 24 }, 25 uncheckBoxes: true, 26 acceptBtnLabel: 'Cookies akzeptieren', 27 advancedBtnLabel: 'Einstellungen bearbeiten', 28 moreInfoLabel: 'Mehr Informationen', 29 cookieTypesTitle: 'Wählen Sie aus, welche Cookies Sie akzeptieren möchten.', 30 fixedCookieTypeLabel: 'Notwendig', 31 fixedCookieTypeDesc: 'Notwendige Cookies ermöglichen grundlegende Funktionen und sind für die einwandfreie Funktion der Website erforderlich.', 32 cookieTypes: [ 33 { 34 type:'Analytics', 35 value:'analytics', 36 description:'Analytics-Cookies helfen Webseiten-Besitzern zu verstehen, wie Besucher mit Webseiten interagieren, indem Informationen anonym gesammelt und gemeldet werden.' 37 } 38 ] 39 } 40 $(document).ready(function() { 41 var cookieControl = Cookies.get('cookieControl'); 42 if (cookieControl === 'true') { 43 $('body').ihavecookies(options); 44 } else { 45 $('body').ihavecookies(options, 'reinit'); 46 } 47 console.log(cookieControl); 48 //$('body').ihavecookies(options); 49 if ($.fn.ihavecookies.preference('analytics') === true) { 50 console.log('analytics true'); 51 setGA(gaId); 52 } 53 54 $('.ihavecookiesBtn').on('click', function(e){ 55 $('body').ihavecookies(options, 'reinit'); 56 e.preventDefault(); 57 }); 58 }); 59 60 function setGA(gaId) { 61 console.log('set GA'); 62 window.dataLayer = window.dataLayer || []; 63 function gtag(){dataLayer.push(arguments);} 64 gtag('js', new Date()); 65 gtag('config', gaId); 66 } 67 function removeGA(gaId, domain) { 68 console.log('remove GA'); 69 var currentdomain; 70 var separate = domain.host.split('.'); 71 if (separate.length > 2) { 72 separate.shift(); 73 currentdomain = separate.join('.'); 74 } else { 75 currentdomain = domain.host; 76 } 77 78 var removeGaId = replaceAll(gaId, '-', '_'); 79 Cookies.remove('_gid', { path: '', domain: '.'+currentdomain }); 80 Cookies.remove('_ga', { path: '', domain: '.'+currentdomain }); 81 Cookies.remove('_gat_gtag_'+removeGaId, { path: '', domain: '.'+currentdomain }); 82 Cookies.remove('_ga_'+gaId.replace('G-', ''), { path: '', domain: '.'+currentdomain }); 83 } 84 function replaceAll(str, find, replace) { 85 return str.replace(new RegExp(find, 'g'), replace); 86 } 87}) ( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.