-
Notifications
You must be signed in to change notification settings - Fork 2
/
gtm-basic.html
61 lines (56 loc) · 2.04 KB
/
gtm-basic.html
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>🍪 Leckerli - GTM (Basic)</title>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-NGL2FLK');</script>
<!-- End Google Tag Manager -->
</head>
<body style="background: #cbd5e1; display: grid; place-content: center; font-family: sans-serif; min-height: 100vh;">
<h1>Your website here 🤗 - GTM (Basic)</h1>
<script>
window.leckerliSettings = {
title: 'This website uses GTM & Google Consent.'
}
</script>
<script>
// To listen the initialisation
document.addEventListener('leckerli:initialised', (event) => {
// to get cookie data OR null if the user's choice has not been made
console.log('init', event.detail.cookie);
});
// To listen to the permissions / cookie's updates
document.addEventListener('leckerli:permissions-updated', (event) => {
// to get cookie data
console.log('update', event.detail.cookie);
});
// To listen the modal states
document.addEventListener('leckerli:modal-opened', () => {
// react to modal opened
console.log('modal opened')
});
document.addEventListener('leckerli:modal-closed', () => {
// react to modal closed
console.log('modal closed')
});
</script>
<style>
/*
:root {
--leckerli-foreground: #fff;
--leckerli-background: #000;
--leckerli-primary: #ff0099;
--leckerli-primary-hover: #d1007e;
--leckerli-primary-active: #9D005F;
--leckerli-font: sans-serif;
}
*/
</style>
</body>
</html>