Analytics

This commit is contained in:
Simon Cambier 2022-02-26 20:50:07 +01:00
parent 6edc8a8232
commit 1909b75663
4 changed files with 21 additions and 0 deletions

View File

@ -14,6 +14,7 @@
"date-fns": "^2.28.0", "date-fns": "^2.28.0",
"date-fns-tz": "^1.2.2", "date-fns-tz": "^1.2.2",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"plausible-tracker": "^0.3.5",
"vue": "^3.2.31", "vue": "^3.2.31",
"vue-i18n": "^9.1.9", "vue-i18n": "^9.1.9",
"vue-router": "^4.0.12" "vue-router": "^4.0.12"

View File

@ -25,6 +25,7 @@ specifiers:
eslint-plugin-vue: ^8.5.0 eslint-plugin-vue: ^8.5.0
jsdom: ^19.0.0 jsdom: ^19.0.0
lodash-es: ^4.17.21 lodash-es: ^4.17.21
plausible-tracker: ^0.3.5
postcss: ^8.4.6 postcss: ^8.4.6
prettier: ^2.5.1 prettier: ^2.5.1
prettier-eslint: ^13.0.0 prettier-eslint: ^13.0.0
@ -44,6 +45,7 @@ dependencies:
date-fns: 2.28.0 date-fns: 2.28.0
date-fns-tz: 1.2.2_date-fns@2.28.0 date-fns-tz: 1.2.2_date-fns@2.28.0
lodash-es: 4.17.21 lodash-es: 4.17.21
plausible-tracker: 0.3.5
vue: 3.2.31 vue: 3.2.31
vue-i18n: 9.1.9_vue@3.2.31 vue-i18n: 9.1.9_vue@3.2.31
vue-router: 4.0.12_vue@3.2.31 vue-router: 4.0.12_vue@3.2.31
@ -4418,6 +4420,11 @@ packages:
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
dev: true dev: true
/plausible-tracker/0.3.5:
resolution: {integrity: sha512-6c6VPdPtI9KmIsfr8zLBViIDMt369eeaNA1J8JrAmAtrpSkeJWvjwcJ+cLn7gVJn5AtQWC8NgSEee2d/5RNytA==}
engines: {node: '>=10'}
dev: false
/postcss-js/4.0.0_postcss@8.4.6: /postcss-js/4.0.0_postcss@8.4.6:
resolution: {integrity: sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ==} resolution: {integrity: sha512-77QESFBwgX4irogGVPgQ5s07vLvFqWr228qZY+w6lW599cRlK/HmnlivnnVUxkjHnCu4J16PDMHcH+e+2HbvTQ==}
engines: {node: ^12 || ^14 || >= 16} engines: {node: ^12 || ^14 || >= 16}

View File

@ -20,8 +20,14 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { onMounted } from 'vue'
import AppHeader from '@/components/AppHeader.vue' import AppHeader from '@/components/AppHeader.vue'
import SideMenu from '@/components/SideMenu.vue' import SideMenu from '@/components/SideMenu.vue'
import ToastMessage from '@/components/ToastMessage.vue' import ToastMessage from '@/components/ToastMessage.vue'
import { plausible } from '@/analytics'
onMounted(() => {
plausible.enableAutoPageviews()
})
</script> </script>

7
src/analytics.ts Normal file
View File

@ -0,0 +1,7 @@
import Plausible from 'plausible-tracker'
// Setup tracking
export const plausible = Plausible({
domain: 'n0mbers.scambier.xyz',
apiHost: 'https://stats.scambier.xyz',
})