Merge pull request #3574 from betagouv/fix-3542-matomo-js

Fix Turbolinks page views are not tracked properly in matomo #3542
This commit is contained in:
LeSim 2019-03-08 17:56:35 +01:00 committed by GitHub
commit 5605ceacc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@
addEventListener('turbolinks:load', function(event) {
if (previousPageUrl) {
_paq.push(['setReferrerUrl', previousPageUrl]);
_paq.push(['setCustomUrl', '/' + window.location.href]);
_paq.push(['setCustomUrl', window.location.href]);
_paq.push(['setDocumentTitle', document.title]);
if (event.data && event.data.timing) {
_paq.push(['setGenerationTimeMs', event.data.timing.visitEnd - event.data.timing.visitStart]);