Skip to content

Commit

Permalink
chore: update docusaurus template (#821)
Browse files Browse the repository at this point in the history
Signed-off-by: aeneasr <aeneasr@users.noreply.github.com>

Co-authored-by: aeneasr <aeneasr@users.noreply.github.com>
  • Loading branch information
aeneasr and aeneasr committed Jan 27, 2022
1 parent 226aea8 commit 31cc98a
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 31cc98a

Please sign in to comment.