-
Notifications
You must be signed in to change notification settings - Fork 1
Piwik page tracking
Sam Goshorn edited this page Sep 6, 2016
·
8 revisions
Following the pattern for starting a CALI Author lesson which is this:
https://www.cali.org/lesson/run/EVD04/528/jq
we call Piwik whenever the lesson changes page by sending a URL in a similar form:
https://www.cali.org/lesson/run/EVD04/528/jq/page/About this lesson
https://www.cali.org/lesson/run/EVD04/528/jq/page/Negligence Q1
using this code in the page changing logic:
var piwikURL ='/lesson/run/'+ book.lesson +'/'+lid+'/jq/page/'+escape(page.name);
_paq.push(['setCustomUrl', piwikURL]);
_paq.push(['setDocumentTitle', book.lesson + ' | ' + escape(page.name) ]);
_paq.push(['trackPageView']);
The /page is added as a convenient way to filter so /jq/page/
would return only lesson page visits.