mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Solved Matomo domain bug and refactored
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
# Deactivate CSP header
|
||||
add_header Content-Security-Policy: "";
|
||||
|
||||
# sub filters to integrate matomo tracking code in nginx websites
|
||||
sub_filter '</body>' '<noscript><p><img src="//matomo.{{primary_domain}}/matomo.php?idsite={{matomo_site_id}}&rec=1" style="border:0;" alt="" /></p></noscript></body>';
|
15
roles/nginx-modifier-matomo/templates/matomo-tracking.js.j2
Normal file
15
roles/nginx-modifier-matomo/templates/matomo-tracking.js.j2
Normal file
@@ -0,0 +1,15 @@
|
||||
var _paq = window._paq = window._paq || [];
|
||||
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
|
||||
_paq.push(["setCookieDomain", "*.{{base_domain}}"]);
|
||||
_paq.push(["setDomains", ["*.{{base_domain}}"]]);
|
||||
_paq.push(["enableCrossDomainLinking"]);
|
||||
_paq.push(["trackPageView"]);
|
||||
_paq.push(["trackAllContentImpressions"]);
|
||||
_paq.push(["enableLinkTracking"]);
|
||||
(function() {
|
||||
var u="//{{domains.matomo}}/";
|
||||
_paq.push(["setTrackerUrl", u+"matomo.php"]);
|
||||
_paq.push(["setSiteId", "{{matomo_site_id}}"]);
|
||||
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
|
||||
g.async=true; g.src=u+"matomo.js"; s.parentNode.insertBefore(g,s);
|
||||
})();
|
1
roles/nginx-modifier-matomo/templates/script.j2
Normal file
1
roles/nginx-modifier-matomo/templates/script.j2
Normal file
@@ -0,0 +1 @@
|
||||
<script>{{matomo_tracking_code_one_liner}}</script>
|
Reference in New Issue
Block a user