From 31cc98ac538f831e39a5cde302c322dde2715aaa Mon Sep 17 00:00:00 2001 From: hackerman <3372410+aeneasr@users.noreply.github.com> Date: Thu, 27 Jan 2022 14:44:09 +0100 Subject: [PATCH] chore: update docusaurus template (#821) Signed-off-by: aeneasr Co-authored-by: aeneasr --- docs/src/plugins/docusaurus-plugin-matamo/analytics.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/src/plugins/docusaurus-plugin-matamo/analytics.js b/docs/src/plugins/docusaurus-plugin-matamo/analytics.js index d14972448..e0dc03963 100644 --- a/docs/src/plugins/docusaurus-plugin-matamo/analytics.js +++ b/docs/src/plugins/docusaurus-plugin-matamo/analytics.js @@ -12,6 +12,7 @@ export default (function () { return null } + let lastLocation = window.location.pathname return { onRouteUpdate({ location }) { if (!window._paq) { @@ -22,6 +23,11 @@ export default (function () { ? location.pathname + location.search + location.hash : undefined + if (lastLocation === location.pathname) { + return + } + lastLocation = location.pathname + _paq.push(['setCustomUrl', pagePath]) _paq.push(['setDocumentTitle', document.domain + '/' + document.title]) _paq.push(['trackPageView'])