added matomo route tracking

This commit is contained in:
2018-11-04 12:41:34 +01:00
parent 1c9b4a41f4
commit d46b38afe6
4 changed files with 12 additions and 3 deletions
+9
View File
@@ -27,6 +27,15 @@ var Layout = {
view(vn){
// console.log('Layout view : lang', vn.attrs.lang);
_i18n.setLang(vn.attrs.lang);
console.log('Layout view : path', m.route.get());
// matomo
// https://matomo.org/blog/2017/02/how-to-track-single-page-websites-using-piwik-analytics/
if(typeof _paq !== 'undefined'){
_paq.push(['setCustomUrl', m.route.get()]);
// _paq.push(['setDocumentTitle', e.title]);
_paq.push(['trackPageView']);
}
return [
m(_Header, vn.attrs),
vn.children,