chefcookie 2.9.0 → 2.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -63
- package/_build/script.js +796 -26
- package/chefcookie.min.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,39 +6,39 @@ chefcookie is a gdpr cookie solution without compromises.
|
|
|
6
6
|
|
|
7
7
|
## features
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
9
|
+
- opt in/out
|
|
10
|
+
- highly customizable
|
|
11
|
+
- custom event tracking
|
|
12
|
+
- duration tracking
|
|
13
|
+
- scroll depth tracking
|
|
14
|
+
- includes basic styling
|
|
15
|
+
- multi language support
|
|
16
|
+
- ships multiple layouts (overlay, bottombar, topbar)
|
|
17
|
+
- supports custom tracking scripts
|
|
18
|
+
- auto disable tracking for logged in wordpress users
|
|
19
|
+
- ie11 support available
|
|
20
|
+
- script grouping with optional optin on script level
|
|
21
|
+
- (intentionally) supports [i don't care about cookies](https://www.i-dont-care-about-cookies.eu)
|
|
22
22
|
|
|
23
23
|
## included
|
|
24
24
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
25
|
+
- [google analytics](https://analytics.google.com)
|
|
26
|
+
- [google tag manager](https://tagmanager.google.com)
|
|
27
|
+
- [facebook ads](https://de-de.facebook.com/business/products/ads)
|
|
28
|
+
- [twitter ads](https://ads.twitter.com)
|
|
29
|
+
- [taboola ads](https://www.taboola.com)
|
|
30
|
+
- [match2one ads](https://www.match2one.com)
|
|
31
|
+
- [microsoft ads](https://ads.microsoft.com)
|
|
32
|
+
- [linkedin](https://business.linkedin.com/marketing-solutions/conversion-tracking)
|
|
33
|
+
- [etracker](https://www.etracker.com)
|
|
34
|
+
- [matomo analytics](https://matomo.org)
|
|
35
|
+
- [smartlook](https://www.smartlook.com)
|
|
36
|
+
- [crazy egg](https://www.crazyegg.com)
|
|
37
|
+
- [google maps](https://developers.google.com/maps/documentation/javascript/tutorial)
|
|
38
38
|
|
|
39
39
|
## references
|
|
40
40
|
|
|
41
|
-
-
|
|
41
|
+
- [changelog](https://github.com/vielhuber/chefcookie/blob/master/CHANGELOG.md)
|
|
42
42
|
|
|
43
43
|
## installation
|
|
44
44
|
|
|
@@ -363,19 +363,19 @@ you also can define custom parameter name/value pairs via `bypass_parameter`.
|
|
|
363
363
|
|
|
364
364
|
the following keywords as keys are reserved:
|
|
365
365
|
|
|
366
|
-
-
|
|
367
|
-
-
|
|
368
|
-
-
|
|
369
|
-
-
|
|
370
|
-
-
|
|
371
|
-
-
|
|
372
|
-
-
|
|
373
|
-
-
|
|
374
|
-
-
|
|
375
|
-
-
|
|
376
|
-
-
|
|
377
|
-
-
|
|
378
|
-
-
|
|
366
|
+
- `analytics`
|
|
367
|
+
- `tagmanager`
|
|
368
|
+
- `facebook`
|
|
369
|
+
- `twitter`
|
|
370
|
+
- `taboola`
|
|
371
|
+
- `match2one`
|
|
372
|
+
- `microsoft`
|
|
373
|
+
- `linkedin`
|
|
374
|
+
- `etracker`
|
|
375
|
+
- `matomo`
|
|
376
|
+
- `smartlook`
|
|
377
|
+
- `crazyegg`
|
|
378
|
+
- `google_maps`
|
|
379
379
|
|
|
380
380
|
if you provide strings as values, chefcookie interprets them appropriately. chefcookie then loads the libraries with reasonable default settings. however, you can execute your own functions in either overwriting the values of these reserved keywords (and provide an object) or use any other keyword.
|
|
381
381
|
|
|
@@ -385,16 +385,16 @@ the best strategy is to add no scripts at all and let chefcookie add the scripts
|
|
|
385
385
|
|
|
386
386
|
if you cannot do that (e.g. when you cannot manipulate the page content), there are a lot of techniques and strategies out there to prevent existing scripts from executing:
|
|
387
387
|
|
|
388
|
-
-
|
|
389
|
-
-
|
|
390
|
-
-
|
|
391
|
-
-
|
|
392
|
-
-
|
|
388
|
+
- use http content-security-policy headers
|
|
389
|
+
- manipulate embeds (set `type="javascript/blocked"` or `alt-src="..."`)
|
|
390
|
+
- monkey patch `document.createElement`
|
|
391
|
+
- watch and modify with `MutationObserver`
|
|
392
|
+
- abuse `document.write`
|
|
393
393
|
|
|
394
394
|
chefcookie is flexible and very well works together with e.g. [yett](https://github.com/snipsco/yett):
|
|
395
395
|
|
|
396
|
-
-
|
|
397
|
-
-
|
|
396
|
+
- init `yett` before chefcookie to block scripts
|
|
397
|
+
- call `unblock()` inside chefcookies custom scripts
|
|
398
398
|
|
|
399
399
|
#### dynamically load a script
|
|
400
400
|
|
|
@@ -439,13 +439,13 @@ here you can also use the following code:
|
|
|
439
439
|
|
|
440
440
|
you can programmatically control chefcookie via javascript:
|
|
441
441
|
|
|
442
|
-
-
|
|
443
|
-
-
|
|
444
|
-
-
|
|
445
|
-
-
|
|
446
|
-
-
|
|
447
|
-
-
|
|
448
|
-
-
|
|
442
|
+
- `cc.open()`: open the cookie banner manually
|
|
443
|
+
- `cc.openWithSettings()`: open the cookie banner including settings manually
|
|
444
|
+
- `cc.isOpen()`: check if cookie banner is opened
|
|
445
|
+
- `cc.close()`: close the cookie banner manually
|
|
446
|
+
- `cc.isClosed()`: check if cookie banner is closed
|
|
447
|
+
- `cc.destroy()`: destroy the cookie banner and all event listeners
|
|
448
|
+
- `cc.updateOptOutOptIn()`: refreshes the state of opt out / opt in buttons
|
|
449
449
|
|
|
450
450
|
#### exclude user agent
|
|
451
451
|
|
|
@@ -459,8 +459,6 @@ const cc = new chefcookie({
|
|
|
459
459
|
});
|
|
460
460
|
```
|
|
461
461
|
|
|
462
|
-
currently the default regex `/(Mozilla\/5\.0 \(Linux; Android 11; moto g power \(2022\)\) AppleWebKit\/537\.36 \(KHTML, like Gecko\) Chrome\/109\.0.0.0 Mobile Safari\/537\.36)|(Mozilla\/5\.0 \(Macintosh; Intel Mac OS X 10_15_7\) AppleWebKit\/537\.36 \(KHTML, like Gecko\) Chrome\/109\.0\.0\.0 Safari\/537\.36)|(Speed Insights)|(Chrome-Lighthouse)|(PSTS[\d\.]+)/` excludes Google PageSpeed Insights, Chrome Lighthouse and WebPageTest.org.
|
|
463
|
-
|
|
464
462
|
#### consent manager tracking
|
|
465
463
|
|
|
466
464
|
to test the acceptance of the consent manager, it is recommended to use the `consent_tracking`-option. if you specify an url (relative or absolute) there, chefcookie sends a post-request with analysis data for every action that a user performs in the consent manager. these requests have the form:
|
|
@@ -480,13 +478,13 @@ take note that nor ip or user agent are posted, but feel free to catch and store
|
|
|
480
478
|
|
|
481
479
|
the `action`-key can have the following values:
|
|
482
480
|
|
|
483
|
-
-
|
|
484
|
-
-
|
|
485
|
-
-
|
|
486
|
-
-
|
|
487
|
-
-
|
|
488
|
-
-
|
|
489
|
-
-
|
|
481
|
+
- `open`: the consent manager is shown
|
|
482
|
+
- `accept_all`: all providers are accepted
|
|
483
|
+
- `accept_partially`: providers are accepted partially
|
|
484
|
+
- `decline`: all providers are declined
|
|
485
|
+
- `settings_open`: settings are opened
|
|
486
|
+
- `settings_close`: settings are closed
|
|
487
|
+
- `first_user_interaction`: first mouse/touch/scroll interaction happened
|
|
490
488
|
|
|
491
489
|
here it makes sense to temporarily store this data in a database and evaluate it – for example, to measure the discrepancy between the real visitor numbers and the numbers in google analytics or to optimize the appearance of the consent manager (e.g. using the `layout`-option).
|
|
492
490
|
|