Skip to content

Commit

Permalink
chore: update docusaurus template
Browse files Browse the repository at this point in the history
Signed-off-by: aeneasr <aeneasr@users.noreply.github.com>
  • Loading branch information
aeneasr committed Jan 27, 2022
1 parent e49dbbd commit 2d359d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/src/plugins/docusaurus-plugin-matamo/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default (function () {
return null
}

let lastLocation = window.location.pathname
return {
onRouteUpdate({ location }) {
if (!window._paq) {
Expand All @@ -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'])
Expand Down

0 comments on commit 2d359d9

Please sign in to comment.