Move matomo code to seperate script to ease implementing Content-Security-Policy header.
This commit is contained in:
parent
c6e71c2a88
commit
91106240a9
1 changed files with 16 additions and 12 deletions
13
assets/js/tracking.js
Normal file
13
assets/js/tracking.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
* @file
|
||||
* A JavaScript file for matomo analytic tracking.
|
||||
*/
|
||||
|
||||
var idSite = {{ .Site.Params.piwikSiteID }};
|
||||
var matomoTrackingApiUrl = 'https://{{ .Site.Params.piwikTrackerUrl }}/matomo.php';
|
||||
|
||||
var _paq = window._paq || [];
|
||||
_paq.push(['setTrackerUrl', matomoTrackingApiUrl]);
|
||||
_paq.push(['setSiteId', idSite]);
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
Loading…
Reference in a new issue