MediaWiki:CommonHeader: Difference between revisions

Created page with "<!-- CookieConsent --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.1/cookieconsent.min.css" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.1/cookieconsent.min.js" defer></script> <script> window.addEventListener("load", function () { window.cookieconsent.initialise({ palette: { popup: { background: "#000" }, button: { background: "#f1d600" } }, theme: "classic", type: "opt..."
 
Blanked the page
Tag: Blanking
 
Line 1: Line 1:
<!-- CookieConsent -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.1/cookieconsent.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.1/cookieconsent.min.js" defer></script>
<script>
window.addEventListener("load", function () {
  window.cookieconsent.initialise({
    palette: {
      popup: { background: "#000" },
      button: { background: "#f1d600" }
    },
    theme: "classic",
    type: "opt-in",
    content: {
      message: "Vi använder cookies för att förbättra din upplevelse.",
      dismiss: "Acceptera",
      deny: "Nej tack",
      link: "Läs mer",
      href: "/index.php/Privacy_policy"
    },
    onInitialise: function (status) {
      if (status == "allow") loadAnalytics();
    },
    onStatusChange: function (status) {
      if (status == "allow") loadAnalytics();
    }
  });


  function loadAnalytics() {
    window.dataLayer = window.dataLayer || [];
    function gtag() { dataLayer.push(arguments); }
    gtag('js', new Date());
    gtag('config', 'G-69RWRYHQ2C'); // <-- din GA4-ID här
    var gaScript = document.createElement('script');
    gaScript.async = true;
    gaScript.src = 'https://www.googletagmanager.com/gtag/js?id=G-69RWRYHQ2C';
    document.head.appendChild(gaScript);
  }
});
</script>