Merge pull request #6766 from betagouv/dont-track-external-urls

This commit is contained in:
Pierre de La Morinerie 2021-12-23 09:56:03 +01:00 committed by GitHub
commit a633f3eb37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,12 +7,19 @@ if (enabled) {
const trackerUrl = `${url}piwik.php`;
const jsUrl = `${url}piwik.js`;
//
// Configure Matomo analytics
//
window._paq.push(['setCookieDomain', '*.www.demarches-simplifiees.fr']);
window._paq.push(['setDomains', ['*.www.demarches-simplifiees.fr']]);
// Dont store any cookies or send any tracking request when the "Do Not Track" browser setting is enabled.
window._paq.push(['setDoNotTrack', true]);
// When enabling external link tracking, consider that it will also report links to attachments.
// Youll want to exclude links to attachments from being tracked for instance using Matomo's
// `setCustomRequestProcessing` callback.
// window._paq.push(['enableLinkTracking']);
window._paq.push(['trackPageView']);
window._paq.push(['enableLinkTracking']);
// Load script from Matomo
window._paq.push(['setTrackerUrl', trackerUrl]);