forked from linus-sch/Mind-Map-Wizard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsent.js
More file actions
39 lines (32 loc) · 958 Bytes
/
consent.js
File metadata and controls
39 lines (32 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('consent', 'default', {
'analytics_storage': 'denied'
});
gtag('config', 'G-4RTLM6HX39');
function showPopup() {
document.getElementById('legalPopup').style.display = 'flex';
}
function closePopup() {
document.getElementById('legalPopup').style.display = 'none';
}
function acceptDisclaimer() {
localStorage.setItem('disclaimerAccepted', 'true');
gtag('consent', 'update', {
'analytics_storage': 'granted'
});
dataLayer.push({
'event': 'cookie_consent_accepted',
'consent_type': 'functionality_and_analytics'
});
closePopup();
generateMindmap();
}
window.onload = function() {
if (localStorage.getItem('disclaimerAccepted') === "true" || localStorage.getItem('mindmap-history')) {
document.getElementById('legalPopup').style.display = 'none';
}
};