Skip to content

Commit 3722500

Browse files
authored
Merge pull request #22 from pReya/master
Feature: Add 'disableCookies' option
2 parents 6c8973a + 07317cf commit 3722500

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ Here is an overview of the available options with their default values:
6969

7070
```php
7171
return array(
72-
'sylvainjule.matomo.url' => false, #required
73-
'sylvainjule.matomo.id' => false, #required
74-
'sylvainjule.matomo.token' => false, #required for the panel integration
75-
'sylvainjule.matomo.active' => true,
76-
'sylvainjule.matomo.debug' => false,
77-
'sylvainjule.matomo.trackUsers' => false,
78-
'sylvainjule.matomo.blacklist' => ['127.0.0.1', '::1'],
72+
'sylvainjule.matomo.url' => false, #required
73+
'sylvainjule.matomo.id' => false, #required
74+
'sylvainjule.matomo.token' => false, #required for the panel integration
75+
'sylvainjule.matomo.active' => true,
76+
'sylvainjule.matomo.debug' => false,
77+
'sylvainjule.matomo.trackUsers' => false,
78+
'sylvainjule.matomo.disableCookies' => false,
79+
'sylvainjule.matomo.blacklist' => ['127.0.0.1', '::1'],
7980
);
8081
```
8182

@@ -137,6 +138,14 @@ If you want to always run the script (even on localhost or if you are logged in)
137138
'sylvainjule.matomo.debug' => false
138139
```
139140

141+
#### 3.8. `disableCookies`
142+
143+
If you want to use Matomo without any tracking cookies on the user side, set this option to `true`. You can read more about this setting in the [Matomo FAQ](https://matomo.org/faq/general/faq_157/).
144+
145+
```php
146+
'sylvainjule.matomo.debug' => false
147+
```
148+
140149
<br/>
141150

142151
## 4. Template usage

lib/snippets/matomo.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
<script type="text/javascript">
44
var _paq = window._paq || [];
5+
<?php if(option('sylvainjule.matomo.disableCookies')) :?>
6+
_paq.push(['disableCookies']);
7+
<?php endif; ?>
58
_paq.push(['trackPageView']);
69
_paq.push(['enableLinkTracking']);
710
(function() {
@@ -16,5 +19,5 @@
1619
<?php else : ?>
1720

1821
<!-- Kirby Matomo -->
19-
20-
<?php endif; ?>
22+
23+
<?php endif; ?>

0 commit comments

Comments
 (0)