1// initialization code here (will be executed only once per page-load) 2window.googleTagManagerOnInit = function () { 3 window.dataLayer = window.dataLayer || []; 4 window.gtag = function () { 5 dataLayer.push(arguments) 6 } 7 gtag('consent', 'default', { 8 'ad_storage': 'denied', 9 'analytics_storage': 'denied', 10 'ad_user_data': 'denied', 11 'ad_personalization': 'denied' 12 }) 13 gtag('set', 'ads_data_redaction', true) 14} 15 16// we notify the tag manager about all services that were accepted. You can define 17// a custom event in GTM to load the service if consent was given. 18window.googleTagManagerOnAccept = function () { 19 // check if opts exists 20 if (typeof opts === "undefined") { 21 return; 22 } 23 24 for (let k of Object.keys(opts.consents)) { 25 if (opts.consents[k]) { 26 let eventName = 'klaro-' + k + '-accepted' 27 dataLayer.push({'event': eventName}) 28 } 29 } 30} 31 32window.googleAdsOnAccept = function () { 33 if (typeof gtag === "undefined") { 34 return; 35 } 36 37 // we grant ad storage and personalization 38 gtag('consent', 'update', { 39 'ad_storage': 'granted', 40 'ad_user_data': 'granted', 41 'ad_personalization': 'granted' 42 }) 43} 44 45window.googleAdsOnDecline = function () { 46 if (typeof gtag === "undefined") { 47 return; 48 } 49 50 // we decline ad storage and personalization 51 gtag('consent', 'update', { 52 'ad_storage': 'denied', 53 'ad_user_data': 'denied', 54 'ad_personalization': 'denied' 55 }) 56}
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.