From a05f5edafc89b3bbc1ae5f640615f940904379d6 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 28 Aug 2026 12:21:41 +0000 Subject: [PATCH] ena sama pasica: ostane Googlov certificirani CMP Nasa lastna pasica ni certificiran CMP in Googlu prek TCF ne poslje nicesar - karkoli je uporabnik na njej kliknil, na oglase ni vplivalo. Zato sta se prikazovali dve, pravno pa je stela samo Googlova. Ostane Googlova, ki pokriva tudi personalizirane oglase. Videz se uskladi z barvami folx.tv v AdSense urejevalniku sporocila (Privacy & messaging -> European regulations). --- client/src/App.tsx | 2 - client/src/components/CookieConsent.tsx | 248 ------------------------ 2 files changed, 250 deletions(-) delete mode 100644 client/src/components/CookieConsent.tsx diff --git a/client/src/App.tsx b/client/src/App.tsx index 41ec0df..af3b089 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -3,7 +3,6 @@ import { queryClient } from "./lib/queryClient"; import { QueryClientProvider } from "@tanstack/react-query"; import { Toaster } from "@/components/ui/toaster"; import { TooltipProvider } from "@/components/ui/tooltip"; -import CookieConsent from "@/components/CookieConsent"; import Home from "@/pages/home"; import VideoPage from "@/pages/VideoPage"; import FolxStadlPage from "@/pages/FolxStadlPage"; @@ -45,7 +44,6 @@ function App() { - diff --git a/client/src/components/CookieConsent.tsx b/client/src/components/CookieConsent.tsx deleted file mode 100644 index 7496038..0000000 --- a/client/src/components/CookieConsent.tsx +++ /dev/null @@ -1,248 +0,0 @@ -import { useState, useEffect } from 'react'; -import { Button } from '@/components/ui/button'; -import { X } from 'lucide-react'; - -interface ConsentState { - necessary: boolean; - analytics: boolean; - advertising: boolean; -} - -export default function CookieConsent() { - const [showBanner, setShowBanner] = useState(false); - const [showDetails, setShowDetails] = useState(false); - const [consent, setConsent] = useState({ - necessary: true, - analytics: false, - advertising: false - }); - - useEffect(() => { - // Check if user has already given consent - const savedConsent = localStorage.getItem('cookie_consent'); - if (savedConsent) { - try { - const parsedConsent = JSON.parse(savedConsent); - setConsent(parsedConsent); - updateGoogleConsent(parsedConsent); - setShowBanner(false); // Don't show banner if consent already exists - } catch (error) { - // If parsing fails, show banner - setShowBanner(true); - } - } else { - // No saved consent, show banner - setShowBanner(true); - } - }, []); - - const updateGoogleConsent = (consentState: ConsentState) => { - if (window.gtag) { - window.gtag('consent', 'update', { - 'ad_storage': consentState.advertising ? 'granted' : 'denied', - 'analytics_storage': consentState.analytics ? 'granted' : 'denied', - 'ad_user_data': consentState.advertising ? 'granted' : 'denied', - 'ad_personalization': consentState.advertising ? 'granted' : 'denied' - }); - } - }; - - const handleAcceptAll = () => { - const newConsent = { - necessary: true, - analytics: true, - advertising: true - }; - - setConsent(newConsent); - updateGoogleConsent(newConsent); - localStorage.setItem('cookie_consent', JSON.stringify(newConsent)); - setShowBanner(false); - setShowDetails(false); - }; - - const handleRejectAll = () => { - const newConsent = { - necessary: true, - analytics: false, - advertising: false - }; - - setConsent(newConsent); - updateGoogleConsent(newConsent); - localStorage.setItem('cookie_consent', JSON.stringify(newConsent)); - setShowBanner(false); - setShowDetails(false); - }; - - const handleSavePreferences = () => { - updateGoogleConsent(consent); - localStorage.setItem('cookie_consent', JSON.stringify(consent)); - setShowBanner(false); - setShowDetails(false); - }; - - const handleConsentChange = (key: keyof ConsentState, value: boolean) => { - if (key === 'necessary') return; // Cannot disable necessary cookies - setConsent(prev => ({ ...prev, [key]: value })); - }; - - if (!showBanner) return null; - - return ( -
-
-
- {!showDetails ? ( - // Simple banner -
-
-
-
-
-
-

Cookie-Einstellungen

-
- -
- -

- Wir verwenden Cookies und ähnliche Technologien, um unsere Website zu verbessern, - Inhalte zu personalisieren und Werbung zu schalten. Durch das Fortsetzen der Nutzung - unserer Website stimmen Sie der Verwendung von Cookies zu. -

- -
- - - -
-
- ) : ( - // Detailed settings -
-
-

Cookie-Einstellungen

- -
- -
- {/* Necessary Cookies */} -
-
-

Notwendige Cookies

-
- Immer aktiv -
-
-

- Diese Cookies sind für das Funktionieren der Website erforderlich und können - in unseren Systemen nicht deaktiviert werden. -

-
- - {/* Analytics Cookies */} -
-
-

Analyse-Cookies

- -
-

- Diese Cookies ermöglichen es uns, Besuche und Verkehrsquellen zu zählen, - damit wir die Leistung unserer Website messen und verbessern können. -

-
- - {/* Advertising Cookies */} -
-
-

Werbe-Cookies

- -
-

- Diese Cookies werden von Werbepartnern über unsere Website gesetzt. Sie können - verwendet werden, um ein Profil Ihrer Interessen zu erstellen und relevante - Werbung auf anderen Websites zu zeigen. -

-
-
- -
- - - -
-
- )} -
-
-
- ); -} - -// Global declaration for gtag -declare global { - interface Window { - gtag: (...args: any[]) => void; - } -} \ No newline at end of file