Add GDPR cookie-consent banner (Consent Mode v2)

- consent.js: self-contained, non-blocking bottom banner in EN/MK/SI,
  remembers the choice in localStorage, links to the per-language cookie
  policy. Accept -> gtag consent 'update' granted; Decline stays denied.
- Head GA snippet restores a returning visitor's prior "granted" choice
  before the first hit; loads /consent.js on every page.
- Re-openable via window.msosOpenConsent() for a "manage cookies" link.

Verified in-browser: shows for new visitors, Accept grants + remembers,
reload keeps consent without re-prompting, Slovene text + /si/ policy link.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
popovskikandClaude Opus 4.8 committed 2026-08-02 18:30:35 +02:00
1 parent 9a6d2c335c
commit f24fc704d6
203 files changed
+1100

No files matched your search

@@ -14,9 +14,14 @@
ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied',
analytics_storage: 'denied', wait_for_update: 500
});
// Restore a returning visitor's prior choice before the first hit.
try { if (localStorage.getItem('msos-consent') === 'granted') {
gtag('consent', 'update', { ad_storage:'granted', ad_user_data:'granted',
ad_personalization:'granted', analytics_storage:'granted' }); } } catch(e){}
gtag('js', new Date());
gtag('config', 'G-WVYV807VSS');
</script>
<script src="/consent.js" defer></script>
<meta name="description" content="Over 200 students gathered in Maribor, raising €1.000 through sport to support families hit by the Kočani tragedy.">
<link rel="canonical" href="https://msosorg.com/en/projects/humanitarian-tournament-in-maribor/">
<link rel="alternate" hreflang="en" href="https://msosorg.com/en/projects/humanitarian-tournament-in-maribor/">
@@ -14,9 +14,14 @@
ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied',
analytics_storage: 'denied', wait_for_update: 500
});
// Restore a returning visitor's prior choice before the first hit.
try { if (localStorage.getItem('msos-consent') === 'granted') {
gtag('consent', 'update', { ad_storage:'granted', ad_user_data:'granted',
ad_personalization:'granted', analytics_storage:'granted' }); } } catch(e){}
gtag('js', new Date());
gtag('config', 'G-WVYV807VSS');
</script>
<script src="/consent.js" defer></script>
<meta name="description" content="On February 8, 2025, Macedonian students in Ljubljana gathered for a peaceful public event to honor the memory of Frosina Kulakova, who tragically lost her…">
<link rel="canonical" href="https://msosorg.com/en/projects/in-memory-of-frosina-kulakova/">
<link rel="alternate" hreflang="en" href="https://msosorg.com/en/projects/in-memory-of-frosina-kulakova/">
@@ -14,9 +14,14 @@
ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied',
analytics_storage: 'denied', wait_for_update: 500
});
// Restore a returning visitor's prior choice before the first hit.
try { if (localStorage.getItem('msos-consent') === 'granted') {
gtag('consent', 'update', { ad_storage:'granted', ad_user_data:'granted',
ad_personalization:'granted', analytics_storage:'granted' }); } } catch(e){}
gtag('js', new Date());
gtag('config', 'G-WVYV807VSS');
</script>
<script src="/consent.js" defer></script>
<meta name="description" content="On March 21, 2025, more than 600 people gathered at Kongresni trg in Ljubljana for a peaceful public gathering to honor the victims of the tragic fire in Kochani.">
<link rel="canonical" href="https://msosorg.com/en/projects/in-memory-of-the-kochani-victims/">
<link rel="alternate" hreflang="en" href="https://msosorg.com/en/projects/in-memory-of-the-kochani-victims/">
+5
View File
@@ -14,9 +14,14 @@
ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied',
analytics_storage: 'denied', wait_for_update: 500
});
// Restore a returning visitor's prior choice before the first hit.
try { if (localStorage.getItem('msos-consent') === 'granted') {
gtag('consent', 'update', { ad_storage:'granted', ad_user_data:'granted',
ad_personalization:'granted', analytics_storage:'granted' }); } } catch(e){}
gtag('js', new Date());
gtag('config', 'G-WVYV807VSS');
</script>
<script src="/consent.js" defer></script>
<meta name="description" content="The events, projects and moments that bring the Macedonian student community in Slovenia together.">
<link rel="canonical" href="https://msosorg.com/en/projects/">
<link rel="alternate" hreflang="en" href="https://msosorg.com/en/projects/">
@@ -14,9 +14,14 @@
ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied',
analytics_storage: 'denied', wait_for_update: 500
});
// Restore a returning visitor's prior choice before the first hit.
try { if (localStorage.getItem('msos-consent') === 'granted') {
gtag('consent', 'update', { ad_storage:'granted', ad_user_data:'granted',
ad_personalization:'granted', analytics_storage:'granted' }); } } catch(e){}
gtag('js', new Date());
gtag('config', 'G-WVYV807VSS');
</script>
<script src="/consent.js" defer></script>
<meta name="description" content="From an idea to a party with 500 students, that&#x27;s how our story began!">
<link rel="canonical" href="https://msosorg.com/en/projects/macedonian-student-night-in-ljubljana/">
<link rel="alternate" hreflang="en" href="https://msosorg.com/en/projects/macedonian-student-night-in-ljubljana/">
@@ -14,9 +14,14 @@
ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied',
analytics_storage: 'denied', wait_for_update: 500
});
// Restore a returning visitor's prior choice before the first hit.
try { if (localStorage.getItem('msos-consent') === 'granted') {
gtag('consent', 'update', { ad_storage:'granted', ad_user_data:'granted',
ad_personalization:'granted', analytics_storage:'granted' }); } } catch(e){}
gtag('js', new Date());
gtag('config', 'G-WVYV807VSS');
</script>
<script src="/consent.js" defer></script>
<meta name="description" content="Through honest first-hand stories, future students received support for their first step towards their new home.">
<link rel="canonical" href="https://msosorg.com/en/projects/meet-student-slovenia-2023/">
<link rel="alternate" hreflang="en" href="https://msosorg.com/en/projects/meet-student-slovenia-2023/">
@@ -14,9 +14,14 @@
ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied',
analytics_storage: 'denied', wait_for_update: 500
});
// Restore a returning visitor's prior choice before the first hit.
try { if (localStorage.getItem('msos-consent') === 'granted') {
gtag('consent', 'update', { ad_storage:'granted', ad_user_data:'granted',
ad_personalization:'granted', analytics_storage:'granted' }); } } catch(e){}
gtag('js', new Date());
gtag('config', 'G-WVYV807VSS');
</script>
<script src="/consent.js" defer></script>
<meta name="description" content="When student stories turn into the first step towards a new home.">
<link rel="canonical" href="https://msosorg.com/en/projects/meet-student-slovenia-2024/">
<link rel="alternate" hreflang="en" href="https://msosorg.com/en/projects/meet-student-slovenia-2024/">
@@ -14,9 +14,14 @@
ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied',
analytics_storage: 'denied', wait_for_update: 500
});
// Restore a returning visitor's prior choice before the first hit.
try { if (localStorage.getItem('msos-consent') === 'granted') {
gtag('consent', 'update', { ad_storage:'granted', ad_user_data:'granted',
ad_personalization:'granted', analytics_storage:'granted' }); } } catch(e){}
gtag('js', new Date());
gtag('config', 'G-WVYV807VSS');
</script>
<script src="/consent.js" defer></script>
<meta name="description" content="When exams somehow become easier with Saturday morning coffee, burek, and good company in at CTK!">
<link rel="canonical" href="https://msosorg.com/en/projects/morning-coffee-in-front-of-ctk/">
<link rel="alternate" hreflang="en" href="https://msosorg.com/en/projects/morning-coffee-in-front-of-ctk/">
@@ -14,9 +14,14 @@
ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied',
analytics_storage: 'denied', wait_for_update: 500
});
// Restore a returning visitor's prior choice before the first hit.
try { if (localStorage.getItem('msos-consent') === 'granted') {
gtag('consent', 'update', { ad_storage:'granted', ad_user_data:'granted',
ad_personalization:'granted', analytics_storage:'granted' }); } } catch(e){}
gtag('js', new Date());
gtag('config', 'G-WVYV807VSS');
</script>
<script src="/consent.js" defer></script>
<meta name="description" content="Paint, wine, and music brought students together in Gorizia to celebrate Women’s Day and mark the first MSOS Nova Gorica event.">
<link rel="canonical" href="https://msosorg.com/en/projects/paint-and-wine-at-sunset/">
<link rel="alternate" hreflang="en" href="https://msosorg.com/en/projects/paint-and-wine-at-sunset/">
@@ -14,9 +14,14 @@
ad_storage: 'denied', ad_user_data: 'denied', ad_personalization: 'denied',
analytics_storage: 'denied', wait_for_update: 500
});
// Restore a returning visitor's prior choice before the first hit.
try { if (localStorage.getItem('msos-consent') === 'granted') {
gtag('consent', 'update', { ad_storage:'granted', ad_user_data:'granted',
ad_personalization:'granted', analytics_storage:'granted' }); } } catch(e){}
gtag('js', new Date());
gtag('config', 'G-WVYV807VSS');
</script>
<script src="/consent.js" defer></script>
<meta name="description" content="From Ljubljana to Maribor, Macedonian students filled cafés with chants, flags, and laughter while watching the national handball team.">
<link rel="canonical" href="https://msosorg.com/en/projects/watching-handball-together-in-slovenia/">
<link rel="alternate" hreflang="en" href="https://msosorg.com/en/projects/watching-handball-together-in-slovenia/">