Skip to content

Commit

Permalink
Merge pull request #82 from pacstall/develop
Browse files Browse the repository at this point in the history
feat(client): add matomo analytics
  • Loading branch information
saenai255 authored Apr 17, 2022
2 parents 34d1d9c + ce8ce90 commit e78e02c
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions client/index.production.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,46 @@
<link rel="apple-touch-icon" href="public/apple-touch-icon.png" />
<meta name="next-head-count" content="20" />
<link rel="stylesheet" href="public/styles/global.css" />
<script>
var _paq = (window._paq = window._paq || [])

_paq.push(['trackPageView'])
_paq.push(['enableLinkTracking'])
;(function () {
var u = '//pacstall.dev/matomo/'
_paq.push(['setTrackerUrl', u + 'matomo.php'])
_paq.push(['setSiteId', '1'])
var d = document,
g = d.createElement('script'),
s = d.getElementsByTagName('script')[0]
g.async = true
g.src = u + 'matomo.js'
s.parentNode.insertBefore(g, s)
})()
;(function () {
var url = window.location.href
setInterval(function () {
if (url != window.location.href) {
url = window.location.href

// Track page view after 0.75s to catch the title change
setTimeout(function () {
_paq.push([
'setCustomUrl',
window.location.href.split(
'https://pacstall.dev',
)[1],
])
_paq.push([
'setDocumentTitle',
window.document.title,
])
_paq.push(['trackPageView'])
}, 750)
}
}, 100)
})()
</script>
</head>

<body>
Expand Down

0 comments on commit e78e02c

Please sign in to comment.