From a9450b7a381992078d016c88e79cb7b858969d86 Mon Sep 17 00:00:00 2001 From: bastien Date: Thu, 19 Dec 2024 17:17:52 +0100 Subject: [PATCH] Add a "consent" call after clarity service initialization as documented on the clarity API documentation : https://learn.microsoft.com/en-us/clarity/setup-and-installation/clarity-api and as stated in this FAQ : https://learn.microsoft.com/en-us/clarity/faq#why-does-clarity-require-explicit-consent-in-the-european-economic-area--eea---uk--and-switzerland-- --- tarteaucitron.services.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index c578cb21..aa5712ff 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -571,11 +571,11 @@ tarteaucitron.services.freshsalescrm = { "cookies": [], "js": function () { "use strict"; - + if (tarteaucitron.user.freshsalescrmId === undefined) { return; } - + tarteaucitron.addScript('https://eu.fw-cdn.com/' + tarteaucitron.user.freshsalescrmId + '.js'); } }; @@ -2472,7 +2472,9 @@ tarteaucitron.services.clarity = { window["clarity"] = window["clarity"] || function () { (window["clarity"].q = window["clarity"].q || []).push(arguments) }; - tarteaucitron.addScript('https://www.clarity.ms/tag/' + tarteaucitron.user.clarity); + tarteaucitron.addScript('https://www.clarity.ms/tag/' + tarteaucitron.user.clarity, '', function() { + window["clarity"]("consent"); + }); } };