forked from klaro-org/klaro-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
346 lines (311 loc) · 13.8 KB
/
config.js
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
// By default, Klaro will load the config from a global "klaroConfig" variable.
// You can change this by specifying the "data-config" attribute on your
// script take, e.g. like this:
// <script src="klaro.js" data-config="myConfigVariableName" />
var klaroConfig = {
// With the 0.7.0 release we introduce a 'version' paramter that will make
// it easier for us to keep configuration files backwards-compatible in the future.
version: 1,
// You can customize the ID of the DIV element that Klaro will create
// when starting up. If undefined, Klaro will use 'klaro'.
elementID: 'klaro',
// You can override CSS style variables here. For IE11, Klaro will
// dynamically inject the variables into the CSS. If you still consider
// supporting IE9-10 (which you probably shouldn't) you need to use Klaro
// with an external stylesheet as the dynamic replacement won't work there.
styling: {
theme: ['light', 'top', 'wide'],
},
// You can show a description in contextual consent overlays for store
// being empty. In that case the accept always button is omitted.
// The description contains a link for opening the consent manager.
showDescriptionEmptyStore: true,
// Setting this to true will keep Klaro from automatically loading itself
// when the page is being loaded.
noAutoLoad: false,
// Setting this to true will render the descriptions of the consent
// modal and consent notice are HTML. Use with care.
htmlTexts: true,
// Setting 'embedded' to true will render the Klaro modal and notice without
// the modal background, allowing you to e.g. embed them into a specific element
// of your website, such as your privacy notice.
embedded: false,
// You can group services by their purpose in the modal. This is advisable
// if you have a large number of services. Users can then enable or disable
// entire groups of services instead of having to enable or disable every service.
groupByPurpose: true,
// You can make the consent notice autofocused by enabling the following option
autoFocus: false,
// You can show a title in the consent notice by enabling the following option
showNoticeTitle: false,
// How Klaro should store the user's preferences. It can be either 'cookie'
// (the default) or 'localStorage'.
storageMethod: 'cookie',
// You can customize the name of the cookie that Klaro uses for storing
// user consent decisions. If undefined, Klaro will use 'klaro'.
cookieName: 'klaro',
// You can also set a custom expiration time for the Klaro cookie.
// By default, it will expire after 120 days.
cookieExpiresAfterDays: 365,
// You can change to cookie domain for the consent manager itself.
// Use this if you want to get consent once for multiple matching domains.
// If undefined, Klaro will use the current domain.
//cookieDomain: '.github.com',
// You can change to cookie path for the consent manager itself.
// Use this to restrict the cookie visibility to a specific path.
// If undefined, Klaro will use '/' as cookie path.
//cookiePath: '/',
// Defines the default state for services (true=enabled by default).
default: false,
// If "mustConsent" is set to true, Klaro will directly display the consent
// manager modal and not allow the user to close it before having actively
// consented or declines the use of third-party services.
mustConsent: false,
// Show "accept all" to accept all services instead of "ok" that only accepts
// required and "default: true" services
acceptAll: true,
// replace "decline" with cookie manager modal
hideDeclineAll: false,
// hide "learnMore" link
hideLearnMore: false,
// show cookie notice as modal
noticeAsModal: false,
// You can also remove the 'Realized with Klaro!' text in the consent modal.
// Please don't do this! We provide Klaro as a free open source tool.
// Placing a link to our website helps us spread the word about it,
// which ultimately enables us to make Klaro! better for everyone.
// So please be fair and keep the link enabled. Thanks :)
//disablePoweredBy: true,
// you can specify an additional class (or classes) that will be added to the Klaro `div`
//additionalClass: 'my-klaro',
// You can define the UI language directly here. If undefined, Klaro will
// use the value given in the global "lang" variable. If that does
// not exist, it will use the value given in the "lang" attribute of your
// HTML tag. If that also doesn't exist, it will use 'en'.
//lang: 'en',
// You can overwrite existing translations and add translations for your
// service descriptions and purposes. See `src/translations/` for a full
// list of translations that can be overwritten:
// https://github.com/KIProtect/klaro/tree/master/src/translations
// Example config that shows how to overwrite translations:
// https://github.com/KIProtect/klaro/blob/master/src/configs/i18n.js
translations: {
// translationsed defined under the 'zz' language code act as default
// translations.
zz: {
privacyPolicyUrl: '/#privacy',
},
// If you erase the "consentModal" translations, Klaro will use the
// bundled translations.
de: {
privacyPolicyUrl: '/#datenschutz',
consentModal: {
description:
'Hier können Sie einsehen und anpassen, welche Information wir über Sie sammeln. Einträge die als "Beispiel" gekennzeichnet sind dienen lediglich zu Demonstrationszwecken und werden nicht wirklich verwendet.',
},
inlineTracker: {
description: 'Beispiel für ein Inline-Tracking Skript',
},
externalTracker: {
description: 'Beispiel für ein externes Tracking Skript',
},
adsense: {
description: 'Anzeigen von Werbeanzeigen (Beispiel)',
title: 'Google AdSense Werbezeugs',
},
matomo: {
description: 'Sammeln von Besucherstatistiken',
},
camera: {
description:
'Eine Überwachungskamera (nur ein Beispiel zu IMG-Tags)',
},
cloudflare: {
description: 'Schutz gegen DDoS-Angriffe',
},
intercom: {
description:
'Chat Widget & Sammeln von Besucherstatistiken (nur ein Beispiel)',
},
mouseflow: {
description: 'Echtzeit-Benutzeranalyse (nur ein Beispiel)',
},
googleFonts: {
description: 'Web-Schriftarten von Google gehostet',
},
purposes: {
analytics: 'Besucher-Statistiken',
security: 'Sicherheit',
livechat: 'Live Chat',
advertising: 'Anzeigen von Werbung',
styling: 'Styling',
},
},
en: {
consentModal: {
title: '<u>test</u>',
description:
'Here you can see and customize the information that we collect about you. Entries marked as "Example" are just for demonstration purposes and are not really used on this website.',
},
inlineTracker: {
description: 'Example of an inline tracking script',
},
externalTracker: {
description: 'Example of an external tracking script',
},
adsense: {
description: 'Displaying of advertisements (just an example)',
title: 'Google Adsense Advertisement',
},
matomo: {
description: 'Collecting of visitor statistics',
},
camera: {
description:
'A surveillance camera (just an example for an IMG tag)',
},
cloudflare: {
description: 'Protection against DDoS attacks',
},
intercom: {
description:
'Chat widget & collecting of visitor statistics (just an example)',
},
mouseflow: {
description: 'Real-Time user analytics (just an example)',
},
googleFonts: {
description: 'Web fonts hosted by Google',
},
purposes: {
analytics: 'Analytics',
security: 'Security',
livechat: 'Livechat',
advertising: 'Advertising',
styling: 'Styling',
},
},
},
// This is a list of third-party services that Klaro will manage for you.
services: [
{
name: 'twitter',
default: false,
contextualConsentOnly: true,
purposes: ['marketing'],
},
{
name: 'youtube',
default: true,
purposes: ['marketing'],
},
{
// Each service should have a unique (and short) name.
name: 'matomo',
// If "default" is set to true, the service will be enabled by default
// Overwrites global "default" setting.
// We recommend leaving this to "false" for services that collect
// personal information.
default: true,
// The title of your service as listed in the consent modal.
title: 'Matomo/Piwik',
// The purpose(s) of this service. Will be listed on the consent notice.
// Do not forget to add translations for all purposes you list here.
purposes: ['analytics'],
// A list of regex expressions or strings giving the names of
// cookies set by this service. If the user withdraws consent for a
// given service, Klaro will then automatically delete all matching
// cookies.
cookies: [
// you can also explicitly provide a path and a domain for
// a given cookie. This is necessary if you have services that
// set cookies for a path that is not "/" or a domain that
// is not the current domain. If you do not set these values
// properly, the cookie can't be deleted by Klaro
// (there is no way to access the path or domain of a cookie in JS)
// Notice that it is not possible to delete cookies that were set
// on a third-party domain! See the note at mdn:
// https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie#new-cookie_domain
[/^_pk_.*$/, '/', 'klaro.kiprotect.com'], //for the production version
[/^_pk_.*$/, '/', 'localhost'], //for the local version
'piwik_ignore',
],
// An optional callback function that will be called each time
// the consent state for the service changes (true=consented). Passes
// the `service` config as the second parameter as well.
callback: function(consent, service) {
// This is an example callback function.
console.log(
'User consent for service ' + service.name + ': consent=' + consent
);
// To be used in conjunction with Matomo 'requireCookieConsent' Feature, Matomo 3.14.0 or newer
// For further Information see https://matomo.org/faq/new-to-piwik/how-can-i-still-track-a-visitor-without-cookies-even-if-they-decline-the-cookie-consent/
/*
if(consent==true){
_paq.push(['rememberCookieConsentGiven']);
} else {
_paq.push(['forgetCookieConsentGiven']);
}
*/
},
// If "required" is set to true, Klaro will not allow this service to
// be disabled by the user.
required: false,
// If "optOut" is set to true, Klaro will load this service even before
// the user gave explicit consent.
// We recommend always leaving this "false".
optOut: false,
// If "onlyOnce" is set to true, the service will only be executed
// once regardless how often the user toggles it on and off.
onlyOnce: true,
},
// The services will appear in the modal in the same order as defined here.
{
name: 'inlineTracker',
title: 'Inline Tracker',
purposes: ['analytics'],
cookies: ['inline-tracker'],
optOut: false,
},
{
name: 'externalTracker',
title: 'External Tracker',
purposes: ['analytics', 'security'],
cookies: ['external-tracker'],
},
{
name: 'intercom',
title: 'Intercom',
default: true,
purposes: ['livechat'],
},
{
name: 'mouseflow',
title: 'Mouseflow',
purposes: ['analytics'],
},
{
name: 'adsense',
// if you omit the title here Klaro will try to look it up in the
// translations
//title: 'Google AdSense',
purposes: ['advertising'],
},
{
name: 'camera',
title: 'Surveillance Camera',
purposes: ['security'],
},
/* {
name: 'googleFonts',
title: 'Google Fonts',
purposes: ['styling'],
},*/
{
name: 'cloudflare',
title: 'Cloudflare',
purposes: ['security'],
required: true,
},
],
};