diff --git a/fragments/ConsentManager/box_cssjs.php b/fragments/ConsentManager/box_cssjs.php index b3ac2014..3dd9e79a 100644 --- a/fragments/ConsentManager/box_cssjs.php +++ b/fragments/ConsentManager/box_cssjs.php @@ -50,23 +50,29 @@ $googleConsentModeScriptUrl = $addon->getAssetsUrl($googleConsentModeScriptFile); $googleConsentModeOutput .= ' ' . PHP_EOL; - // Debug-Script laden wenn Debug-Modus aktiviert + // Debug-Script laden wenn Debug-Modus aktiviert UND User im Backend eingeloggt if (isset($consent_manager->domainInfo['google_consent_mode_debug']) && 1 === $consent_manager->domainInfo['google_consent_mode_debug']) { - $debugScriptUrl = $addon->getAssetsUrl('consent_debug.js'); - $googleConsentModeOutput .= ' ' . PHP_EOL; - - // Debug-Konfiguration für JavaScript verfügbar machen - $googleConsentModeOutput .= ' ' . PHP_EOL; + // User für Frontend initialisieren + rex_backend_login::createUser(); + + // Nur für eingeloggte Backend-Benutzer + if (rex_backend_login::hasSession() && null !== rex::getUser()) { + $debugScriptUrl = $addon->getAssetsUrl('consent_debug.js'); + $googleConsentModeOutput .= ' ' . PHP_EOL; + + // Debug-Konfiguration für JavaScript verfügbar machen + $googleConsentModeOutput .= ' ' . PHP_EOL; + } } // Auto-Mapping wird jetzt im Frontend-JS gehandhabt