1 2cookiePolicyUpdateConsent = function(token, acceptAll) { 3 4 let allowTracking = $("#cookie-policy-consent-tracking").is(":checked"); 5 let allowFunctional = $("#cookie-policy-consent-functional").is(":checked"); 6 let allowStatistics = $("#cookie-policy-consent-statistics").is(":checked"); 7 8 if (acceptAll) { 9 allowTracking = allowFunctional = allowStatistics = true; 10 } 11 12 setCookiePolicyCookie("DDCookiePolicy-consent-tracking", allowTracking, 365); 13 setCookiePolicyCookie("DDCookiePolicy-consent-functional", allowFunctional, 365); 14 setCookiePolicyCookie("DDCookiePolicy-consent-statistics", allowStatistics, 365); 15 16 if (!allowTracking) cleanUpTrackingCookies(); 17 if (!allowFunctional) cleanUpFunctionalCookies(); 18 if (!allowStatistics) cleanUpStatisticsCookies(); 19 20 const url = `/shop/ajaxwrapper.asp?fc=updateCookieConsentHistory` + 21 `&allowTracking=${convertBooleanValueToInteger(allowTracking)}` + 22 `&allowFunctional=${convertBooleanValueToInteger(allowFunctional)}` + 23 `&allowStatistics=${convertBooleanValueToInteger(allowStatistics)}` + 24 `&cookieConsentToken=${token}`; 25 26 $.ajax({
27 dataType: "json", 28 type: "get", 29 cache: false, 30 url: url, 31 complete: function () { 32 //console.log("Cookie consent updated."); 33 34 // Opdatér Google Consent Mode 35 gtag('consent', 'update', { 36 ad_storage: allowTracking ? 'granted' : 'denied', 37 analytics_storage: allowStatistics ? 'granted' : 'denied', 38 functionality_storage: allowFunctional ? 'granted' : 'denied', 39 personalization_storage: 'denied', 40 security_storage: 'granted' 41 }); 42 43 // Send event til GTM 44 dataLayer.push({ event: 'cookie_consent_given' }); 45 46 // Gem valget i localStorage 47 const consent = { 48 ad: allowTracking, 49 analytics: allowStatistics, 50 functional: allowFunctional 51 }; 52 localStorage.setItem("cookie_consent", JSON.stringify(consent)); 53 54 // Aktiver evt. scripts uden reload 55 cookiePolicyConsentEnableThirdPartyScriptTags(); 56 } 57 }); 58};
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.