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
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+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,
+1 -1
View File
@@ -404,7 +404,7 @@ module.exports = {
// },
view(vn){
// console.log('_ModeText view', vn.attrs.lang);
console.log('_dbs.active_type_filter : ', _dbs.active_type_filter);
// console.log('_dbs.active_type_filter : ', _dbs.active_type_filter);
return m('main', {id:"content", 'class':'mode-text'}, _dbs.data[vn.attrs.lang].map((p) => {
// console.log("MAP _dbs", p);
p.lang = vn.attrs.lang;