-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcookieconsent-config.js
More file actions
412 lines (401 loc) · 20.5 KB
/
cookieconsent-config.js
File metadata and controls
412 lines (401 loc) · 20.5 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
const CAT_NECESSARY = "necessary";
const CAT_ANALYTICS = "analytics";
const CAT_ADVERTISEMENT = "advertisement";
const CAT_FUNCTIONALITY = "functionality";
const CAT_SECURITY = "security";
const SERVICE_AD_STORAGE = 'ad_storage'
const SERVICE_AD_USER_DATA = 'ad_user_data'
const SERVICE_AD_PERSONALIZATION = 'ad_personalization'
const SERVICE_ANALYTICS_STORAGE = 'analytics_storage'
const SERVICE_FUNCTIONALITY_STORAGE = 'functionality_storage'
const SERVICE_PERSONALIZATION_STORAGE = 'personalization_storage'
const SERVICE_SECURITY_STORAGE = 'security_storage'
// Define dataLayer and the gtag function.
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
// Set default consent to 'denied' (this should happen before changing any other dataLayer)
gtag('consent', 'default', {
[SERVICE_AD_STORAGE]: 'denied',
[SERVICE_AD_USER_DATA]: 'denied',
[SERVICE_AD_PERSONALIZATION]: 'denied',
[SERVICE_ANALYTICS_STORAGE]: 'denied',
[SERVICE_FUNCTIONALITY_STORAGE]: 'denied',
[SERVICE_PERSONALIZATION_STORAGE]: 'denied',
[SERVICE_SECURITY_STORAGE]: 'granted',
});
/**
* Update gtag consent according to the users choices made in CookieConsent UI
*/
function updateGtagConsent(sendEvent = false) {
gtag('consent', 'update', {
[SERVICE_ANALYTICS_STORAGE]: CookieConsent.acceptedService(SERVICE_ANALYTICS_STORAGE, CAT_ANALYTICS) ? 'granted' : 'denied',
[SERVICE_AD_STORAGE]: CookieConsent.acceptedService(SERVICE_AD_STORAGE, CAT_ADVERTISEMENT) ? 'granted' : 'denied',
[SERVICE_AD_USER_DATA]: CookieConsent.acceptedService(SERVICE_AD_USER_DATA, CAT_ADVERTISEMENT) ? 'granted' : 'denied',
[SERVICE_AD_PERSONALIZATION]: CookieConsent.acceptedService(SERVICE_AD_PERSONALIZATION, CAT_ADVERTISEMENT) ? 'granted' : 'denied',
[SERVICE_FUNCTIONALITY_STORAGE]: CookieConsent.acceptedService(SERVICE_FUNCTIONALITY_STORAGE, CAT_FUNCTIONALITY) ? 'granted' : 'denied',
[SERVICE_PERSONALIZATION_STORAGE]: CookieConsent.acceptedService(SERVICE_PERSONALIZATION_STORAGE, CAT_FUNCTIONALITY) ? 'granted' : 'denied',
[SERVICE_SECURITY_STORAGE]: 'granted',
});
if (sendEvent) {
const analyticsApproved = CookieConsent.acceptedService(
SERVICE_ANALYTICS_STORAGE,
CAT_ANALYTICS
);
if (window.dataLayer) {
window.dataLayer.push({
"event": "Cookie Consent Approval",
"eventCategory": "Homepage",
"eventAction": analyticsApproved ? "Submit" : "Reject",
"eventLabel": null,
"eventValue": null
});
}
}
}
document.addEventListener('DOMContentLoaded', function () {
const btn = document.getElementById('show-preferencesModal');
if (btn) {
btn.addEventListener('click', function() {
event.preventDefault();
event.stopPropagation();
CookieConsent.showPreferences();
});
}
/**
* All config. options available here:
* https://cookieconsent.orestbida.com/reference/configuration-reference.html
*/
CookieConsent.run({
// Trigger consent update when user choices change
onFirstConsent: () => {
updateGtagConsent();
},
onConsent: () => {
updateGtagConsent(true);
},
onChange: () => {
updateGtagConsent(true);
},
cookie: {
name: 'cc_cookie',
domain: '.zoomsphere.com',
path: '/',
sameSite: 'Lax',
expiresAfterDays: 3650,
},
// Configure categories and services
categories: {
[CAT_NECESSARY]: {
enabled: true, // this category is enabled by default
readOnly: true, // this category cannot be disabled
autoClear: {
cookies: [
{
name: 'intercom-device-id-xn43bho3',
},
{
name: 'intercom-id-xn43bho3',
},
{
name: 'intercom-session-xn43bho3',
}
]
},
services: {
'cc_cookie': {
label: 'Saves your cookie consent settings.',
}
}
},
[CAT_SECURITY]: {
enabled: true, // this category is enabled by default
readOnly: true, // this category cannot be disabled
services: {
[SERVICE_SECURITY_STORAGE]: {
label: 'Enables storage related to security such as authentication functionality, fraud prevention, and other user protection.',
},
}
},
[CAT_ANALYTICS]: {
autoClear: {
cookies: [
{
name: /^_ga/,
},
{
name: '_gid',
},
{
name: '_clck',
},
{
name: '_clsk',
},
{
name: /^_gcl_au/,
},
{
name: 'fs_uid',
},
{
name: 'fs_lua',
}
]
},
services: {
[SERVICE_ANALYTICS_STORAGE]: {
label: 'Enables storage (such as cookies) related to analytics e.g. visit duration.',
}
}
},
[CAT_ADVERTISEMENT]: {
autoClear: {
cookies: [
{
name: '_fbp',
}
]
},
services: {
[SERVICE_AD_STORAGE]: {
label: 'Enables storage (such as cookies) related to advertising.',
},
[SERVICE_AD_USER_DATA]: {
label: 'Sets consent for sending user data related to advertising to Google.',
},
[SERVICE_AD_PERSONALIZATION]: {
label: 'Sets consent for personalized advertising.',
},
}
},
[CAT_FUNCTIONALITY]: {
autoClear: {
cookies: [
{
name: '__hssc',
},
{
name: '__hssrc',
},
{
name: '__hstc',
},
{
name: 'hubspotutk',
}
]
},
services: {
[SERVICE_FUNCTIONALITY_STORAGE]: {
label: 'Enables storage that supports the functionality of the website or app e.g. language settings.',
},
[SERVICE_PERSONALIZATION_STORAGE]: {
label: 'Enables storage related to personalization such as appearance settings, preferences, etc.',
},
}
},
},
guiOptions: {
consentModal: {
layout: 'box wide',
position: 'bottom left',
equalWeightButtons: false,
flipButtons: true
},
preferencesModal: {
layout: 'box',
equalWeightButtons: false,
flipButtons: true
}
},
language: {
default: 'en',
translations: {
en: {
consentModal: {
title: 'Cookie consent',
description: 'This website uses cookies that help the website to function and also to track how you interact with our website. But for us to provide the best user experience, enable the specific cookies from Settings, and click on Accept.',
acceptAllBtn: 'Accept All',
acceptNecessaryBtn: 'Reject All',
showPreferencesBtn: 'Preferences'
},
preferencesModal: {
title: 'Manage cookie preferences',
acceptAllBtn: 'Accept All',
acceptNecessaryBtn: 'Reject All',
savePreferencesBtn: 'Save my preferences',
closeIconLabel: 'Close modal',
sections: [
{
title: 'Cookie usage',
description: `This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they as essential for the working of basic functionalities of the website.
We also use third-party cookies that help us analyze and understand how you use this website, to store user preferences and provide them with content and advertisements that are relevant to you. These cookies will only be stored on your browser with your consent to do so. You also have the option to opt-out of these cookies.But opting out of some of these cookies may have an effect on your browsing experience.`,
},
{
title: 'Strictly Necessary cookies',
description: `These cookies are crucial for the basic functions of the website and the website will not work in its intended way without them.
These cookies do not store any personally identifiable data.`,
//this field will generate a toggle linked to the 'necessary' category
linkedCategory: 'necessary',
cookieTable: {
headers: {
name: "Name",
domain: "Service",
description: "Description",
expiration: "Expiration"
},
body: [
{
name: "cc_cookie",
domain: "This website",
description: "Stores your cookie consent preferences",
expiration: "1 year"
},
{
name: "userId",
domain: "Service",
description: "Stores your user ID",
expiration: "14 months"
},
{
name: "apikey",
domain: "Service",
description: "Stores your user session",
expiration: "14 months"
},
{
name: "intercom-device-id-xn43bho3",
domain: "Intercom",
description: "Uniquely identifies a device across visits to your website",
expiration: "9 months"
},
{
name: "intercom-id-xn43bho3",
domain: "Intercom",
description: "Anonymous visitor identifier cookie",
expiration: "9 months"
},
{
name: "intercom-session-xn43bho3",
domain: "Intercom",
description: "Identifies a session of your website",
expiration: "7 days"
}
]
}
},
{
title: "Analytics",
description: 'Cookies used for analytics help collect data that allows services to understand how users interact with a particular service. These insights allow services both to improve content and to build better features that improve the user\'s experience.',
linkedCategory: CAT_ANALYTICS,
cookieTable: {
headers: {
name: "Name",
domain: "Service",
description: "Description",
expiration: "Expiration"
},
body: [
{
name: "_ga*",
domain: "Google Analytics",
description: "Used to distinguish users in Google Analytics",
expiration: "1 year"
},
{
name: "_gcl_au",
domain: "Google AdSense",
description: "Used by Google AdSense for experimenting with advertisement efficiency",
expiration: "2 years"
},
{
name: "fs_uid",
domain: "FullStory",
description: "Used to uniquely identify users for session tracking and analytics purposes",
expiration: "1 year"
},
{
name: "fs_lua",
domain: "FullStory",
description: "Records the time of the user's last interaction to manage session activity and duration",
expiration: "1 hour"
}
]
}
},
{
title: 'Advertising',
description: 'Google uses cookies for advertising, including serving and rendering ads, personalizing ads (depending on your ad settings at <a href=\"https://g.co/adsettings\">g.co/adsettings</a>), limiting the number of times an ad is shown to a user, muting ads you have chosen to stop seeing, and measuring the effectiveness of ads.',
linkedCategory: CAT_ADVERTISEMENT,
cookieTable: {
headers: {
name: "Name",
domain: "Service",
description: "Description",
expiration: "Expiration"
},
body: [
{
name: "_fbp",
domain: "Facebook",
description: "Used by Facebook to deliver a series of advertisement products such as real-time bidding from third party advertisers",
expiration: "3 months"
}
]
}
},
{
title: 'Functionality',
description: 'Cookies used for functionality allow users to interact with a service or site to access features that are fundamental to that service. Things considered fundamental to the service include preferences like the user\'s choice of language, product optimizations that help maintain and improve a service, and maintaining information relating to a user\'s session, such as the content of a shopping cart.',
linkedCategory: CAT_FUNCTIONALITY,
cookieTable: {
headers: {
name: "Name",
domain: "Service",
description: "Description",
expiration: "Expiration"
},
body: [
{
name: "__hssc",
domain: "HubSpot",
description: "Used to track sessions on HubSpot",
expiration: "30 minutes"
},
{
name: "__hssrc",
domain: "HubSpot",
description: "Used to determine if the user has restarted their browser",
expiration: "Session"
},
{
name: "__hstc",
domain: "HubSpot",
description: "Contains domain, utk, initial timestamp, last timestamp, current timestamp, and session count",
expiration: "6 months"
},
{
name: "hubspotutk",
domain: "HubSpot",
description: "Used to keep track of a visitor's identity. Passed to HubSpot on form submission to associate with a contact",
expiration: "6 months"
}
]
}
},
{
title: 'Security',
description: 'Cookies used for security authenticate users, prevent fraud, and protect users as they interact with a service.',
linkedCategory: CAT_SECURITY,
},
{
title: 'More information',
description: 'For any queries in relation to the policy on cookies and your choices, please <a href="https://www.zoomsphere.com/contacts">contact us</a>.'
}
]
}
}
}
}
});
});