Skip to content

Commit

Permalink
Merge pull request #1440 from Artsdatabanken/feature/issue1439Clarity
Browse files Browse the repository at this point in the history
Feature/issue1439 clarity
  • Loading branch information
steinho authored Oct 15, 2024
2 parents bb6cc86 + f10aea2 commit 7891561
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assessments.Frontend.Web/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<link rel="stylesheet" href="~/css/accordions.css" asp-append-version="true">
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined" rel="stylesheet">
<script src="~/js/cookies.js" asp-append-version="true"></script>
<script src="~/js/cookies.js" asp-append-version="true"></script>
</head>

<body>
Expand Down Expand Up @@ -50,7 +50,7 @@
bruksmønstera til enkeltbrukarar eller annan informasjon som vil kunne krenkje personvernet.
</p>
<p>
Artsdatabanken får brukarstatistikk frå Google Analytics.
Artsdatabanken får brukarstatistikk frå Google Analytics og Microsoft Clarity.
Det medfører at bruken din av nettsidene våre, inklusiv IP-adressa di,
kan bli overført til Google, men vi nyttar Google Analytics sin anonymiseringsfunksjon som sørgjer
for at dei siste siffera i brukaren si IP-adresse blir maskert ved innsamling. IP-maskeringa skjer så snart dataa er mottekne av Google Analytics sitt innsamlingsverk,
Expand Down
7 changes: 7 additions & 0 deletions Assessments.Frontend.Web/wwwroot/js/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ var cookieDurationString = cookieDuration.toUTCString(); // setCookie uses this
m.parentNode.insertBefore(a, m);

})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
(function(c,l,a,r,i,t,y){
c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "oizcojljrc");

// expand read more
function learnAboutCookies() {
Expand Down Expand Up @@ -92,6 +97,7 @@ function hasAcceptedCookies() {
ga('create', 'UA-74815937-4', { 'cookieExpires': cookieDurationSeconds, 'cookieUpdate': 'false', 'cookieFlags': 'Secure' });
ga('send', 'pageview');
themeCookie();
window.clarity('consent');
location.reload();
}
}
Expand All @@ -103,6 +109,7 @@ function hasRejectedCookies() {
sessionStorage['acceptedcookies'] = acceptedcookies;
document.getElementById('heyCookie').style.display = "none";
// TODO: SHOULD LOOP THRU AND DELETE ALL COOKIES.
window.clarity('consent', false);
}
}

Expand Down

0 comments on commit 7891561

Please sign in to comment.