// Define dataLayer and the gtag function. window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} var security_storage = 'granted'; var functionality_storage = 'denied'; var analytics_storage = 'denied'; var ad_storage = 'denied'; var personalization_storage = 'denied'; var ad_user_data = 'denied'; var ad_personalization = 'denied'; // Default ad_storage to 'denied'. gtag('consent', 'default', { 'security_storage:': security_storage, 'functionality_storage:': functionality_storage, 'analytics_storage': analytics_storage, 'ad_storage': ad_storage, 'personalization_storage:': personalization_storage, 'ad_user_data': ad_user_data, 'ad_personalization': ad_personalization, 'wait_for_update': 500 }); //gtag('set', 'url_passthrough', true); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-NZ7HG9M'); consentUpdate(); function consentGranted() { //console.log('ENABLE CUSTOM'); security_storage = (($('#security_storage').prop("checked"))?'granted':'denied'); functionality_storage = (($('#functionality_storage').prop("checked"))?'granted':'denied'); analytics_storage = (($('#analytics_storage').prop("checked"))?'granted':'denied'); ad_storage = (($('#ad_storage').prop("checked"))?'granted':'denied'); personalization_storage = (($('#personalization_storage').prop("checked"))?'granted':'denied'); ad_user_data = (($('#ad_user_data').prop("checked"))?'granted':'denied'); ad_personalization = (($('#ad_personalization').prop("checked"))?'granted':'denied'); gtag('consent', 'update', { 'security_storage:': 'granted', 'functionality_storage:': functionality_storage, 'analytics_storage': analytics_storage, 'ad_storage': ad_storage, 'personalization_storage:': ad_storage, 'ad_user_data': ad_user_data, 'ad_personalization': ad_personalization, 'wait_for_update': 500 }); $.cookie('cc2', security_storage+','+functionality_storage+','+analytics_storage+','+ad_storage+','+personalization_storage+','+ad_user_data+','+ad_personalization+'', { expires: 365, path: '/' }); consentUpdate(); } function consentUpdate(){ $('.security_storage').parent().remove(); $('.functionality_storage').parent().remove(); $('.analytics_storage').parent().remove(); $('.ad_storage').parent().remove(); $('.personalization_storage').parent().remove(); if(ad_storage == "granted"){ dataLayer.push({'event': 'consent-update-ad'}); } if(functionality_storage == "granted"){ dataLayer.push({'event': 'consent-update-func'}); } hideConsentSettings(); } function consentAllGranted() { gtag('consent', 'update', { 'security_storage:': 'granted', 'functionality_storage:': 'granted', 'analytics_storage': 'granted', 'ad_storage': 'granted', 'personalization_storage:': 'granted', 'ad_user_data': 'granted', 'ad_personalization': 'granted', 'wait_for_update': 500 }); security_storage = 'granted'; functionality_storage = 'granted'; analytics_storage = 'granted'; ad_storage = 'granted'; personalization_storage = 'granted'; ad_user_data = 'granted'; ad_personalization = 'granted'; $.cookie('cc2', 'granted,granted,granted,granted,granted,granted,granted', { expires: 365, path: '/' }); consentUpdate(); hideConsentSettings(); } function hideConsentSettings(){ $('#consent-wrapper').fadeOut(); $('body').css({"overflow":"auto"}); } function showConsentSettings(){ $('#consent-wrapper').css({"display":"block"}); $('body').css({"overflow":"hidden"}); } $(document).ready(function(){ showConsentSettings(); $.each($('.consent-chbox'), function(){ if(!$(this).hasClass('onoffswitch-checkbox')){ $(this).onoff(); } }); $('.description').click(function(event){ event.stopPropagation(); }); $('.title-2').click(function(){ itm = $(this).parent().find('.description'); if(itm.css("display") == "none"){ itm.slideDown(); $(this).addClass('title-chevron-active'); } else { itm.slideUp(); $(this).removeClass('title-chevron-active'); } }); });