From 669e9fff5e8f9ec6df605843c03f7edc84eccc08 Mon Sep 17 00:00:00 2001 From: Jacek Pyziak Date: Fri, 21 Mar 2025 23:08:32 +0100 Subject: [PATCH] =?UTF-8?q?Wy=C5=82=C4=85czenie=20debugowania=20czasu=20w?= =?UTF-8?q?=20konfiguracji=20oraz=20dodanie=20obs=C5=82ugi=20zg=C3=B3d=20n?= =?UTF-8?q?a=20pliki=20cookie=20w=20szablonach=20u=C5=BCytkownika?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.php | 2 +- templates_user/cookies.php | 47 ++++++++++++++++++++++++- templates_user/shop-product/product.php | 34 +++++++++--------- 3 files changed, 65 insertions(+), 18 deletions(-) diff --git a/config.php b/config.php index 362678a..b8c2d11 100644 --- a/config.php +++ b/config.php @@ -3,7 +3,7 @@ $database['host'] = 'localhost'; $database['user'] = 'host700513_marianek'; $database['password'] = 'Ngh4GwdctWnU4AshPedV'; $database['name'] = 'host700513_marianek'; -$database['time_debug'] = true; +$database['time_debug'] = false; $database['long_query_time'] = 0.1; $config['salt'] = 'dd6c0ee59bf35b208b6d9bf42dd60769'; diff --git a/templates_user/cookies.php b/templates_user/cookies.php index d4912ed..9c8f6c1 100644 --- a/templates_user/cookies.php +++ b/templates_user/cookies.php @@ -1,2 +1,47 @@ + + + + \ No newline at end of file + const gtmDefaultEuConsent = { + "ad_storage": "denied", + "ad_user_data": "denied", + "ad_personalization": "denied", + "analytics_storage": "denied", + "personalization_storage": "denied", + "functionality_storage": "denied", + "security_storage": "denied", + "region": ["AT", "BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR", "DE", "GR", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", "RO", "SI", "ES", "SE", "GB"] + }; + gtag("consent", "default", gtmDefaultEuConsent); + + $(document).ready(function() { + cookieNoticePro.init(); + }); + + var injectScripts = function injectScripts() { + // Example: Google Analytics + if (cookieNoticePro.isPreferenceAccepted("analytics") === true) { + //console.log("Analytics Scripts Running...."); + } + // Example: Google Adwords cookie, DoubleClick, Remarketing pixels, Social Media cookies + if (cookieNoticePro.isPreferenceAccepted("marketing") === true) { console.log("Marketing Scripts Running...."); + gtag('consent', 'update', { + 'ad_storage': 'granted', + 'ad_user_data': 'granted', + 'ad_personalization': 'granted', + 'analytics_storage': 'granted', + 'personalization_storage': 'granted', + 'security_storage': 'granted', + 'functionality_storage': 'granted' + }); + } + + // Example: Remember password, language, etc + if (cookieNoticePro.isPreferenceAccepted("preferences") === true) { + //console.log("Preferences Scripts Running...."); + } + } + \ No newline at end of file diff --git a/templates_user/shop-product/product.php b/templates_user/shop-product/product.php index 1e89754..da3dccf 100644 --- a/templates_user/shop-product/product.php +++ b/templates_user/shop-product/product.php @@ -263,22 +263,24 @@