Skip to content

Commit

Permalink
tracking(matomo): Adiciona tracking de visitação
Browse files Browse the repository at this point in the history
Fix #37 Tracking de visitação
  • Loading branch information
Phenome committed Oct 31, 2023
1 parent 7c6941a commit 7653652
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defineConfig } from 'astro/config'
import tailwind from '@astrojs/tailwind'

import deno from '@astrojs/deno'
import partytown from '@astrojs/partytown'
import tailwind from '@astrojs/tailwind'
import { defineConfig } from 'astro/config'

// https://astro.build/config
export default defineConfig({
output: 'server',
integrations: [tailwind()],
integrations: [tailwind(), partytown()],
adapter: deno()
})
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@astrojs/deno": "^5.0.1",
"@astrojs/partytown": "^2.0.1",
"@astrojs/tailwind": "^5.0.2",
"astro": "^3.3.3",
"mongodb": "^6.2.0",
Expand Down
19 changes: 19 additions & 0 deletions web/src/layouts/base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ const { title, metaDescription } = Astro.props
/>
<link rel="icon" type="image/png" href="/favicon.png" />
<title>{title}</title>
<!-- Matomo -->
<script type="text/partytown">
var _paq = (window._paq = window._paq || [])
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView'])
_paq.push(['enableLinkTracking'])
; (function () {
var u = '//matomo.dalc.in/'
_paq.push(['setTrackerUrl', u + 'matomo.php'])
_paq.push(['setSiteId', '5'])
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)
})()
</script>
<!-- End Matomo Code -->
</head>
<body>
<slot />
Expand Down
18 changes: 18 additions & 0 deletions web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
unist-util-visit "^4.1.2"
vfile "^5.3.7"

"@astrojs/partytown@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@astrojs/partytown/-/partytown-2.0.1.tgz#7589207d09da3830fe0e51ac4521c203d9cb024a"
integrity sha512-WQC5lR2XINGxvQ35KDu806AVKNsD4Qc6I/am+4JpW6CZb0ccqVt7TSCosTMmYSiuNTInsnV34RAeile88kTtbw==
dependencies:
"@builder.io/partytown" "^0.8.0"
mrmime "^1.0.1"

"@astrojs/prism@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@astrojs/prism/-/prism-3.0.0.tgz#c9443e4cbf435acf0b5adc2c627d9789991514e7"
Expand Down Expand Up @@ -314,6 +322,11 @@
"@babel/helper-validator-identifier" "^7.22.19"
to-fast-properties "^2.0.0"

"@builder.io/partytown@^0.8.0":
version "0.8.1"
resolved "https://registry.yarnpkg.com/@builder.io/partytown/-/partytown-0.8.1.tgz#d50f2508b2e9b554ac890e8130c60b27cfb5958a"
integrity sha512-p4xhEtQCPe8YFJ8e7KT9RptnT+f4lvtbmXymbp1t0bLp+USkNMTxrRMNc3Dlr2w2fpxyX7uA0CyAeU3ju84O4A==

"@esbuild/[email protected]":
version "0.18.20"
resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz#984b4f9c8d0377443cc2dfcef266d02244593622"
Expand Down Expand Up @@ -2598,6 +2611,11 @@ mri@^1.1.0:
resolved "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz"
integrity sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==

mrmime@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/mrmime/-/mrmime-1.0.1.tgz#5f90c825fad4bdd41dc914eff5d1a8cfdaf24f27"
integrity sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==

[email protected]:
version "2.0.0"
resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz"
Expand Down

0 comments on commit 7653652

Please sign in to comment.