Skip to content

Commit 86f0e35

Browse files
authored
feat: move to fork of plausible-analytics (#15)
* feat!: move to fork of plausible-analytics * chore: update process to import.meta * fix: use userOptions * fix: use enable in main plugin * Apply suggestions from code review * fix: order plugins to avoid to use dependsOn * choire: revert nuxt update
1 parent 40c62d6 commit 86f0e35

File tree

10 files changed

+1304
-588
lines changed

10 files changed

+1304
-588
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343
"release": "bumpp --commit --push --tag"
4444
},
4545
"dependencies": {
46+
"@barbapapazes/plausible-tracker": "^0.2.2",
4647
"@nuxt/kit": "^3.8.2",
4748
"defu": "^6.1.3",
48-
"pathe": "^1.1.1",
49-
"plausible-tracker": "^0.3.8"
49+
"pathe": "^1.1.1"
5050
},
5151
"devDependencies": {
5252
"@nuxt/eslint-config": "^0.2.0",

playground/app.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22
const { plausible } = useRuntimeConfig().public
33
44
function trackEvent() {
5-
useTrackEvent('playground')
5+
useTrackEvent('playground', { props: { action: 'click' }, callback: () => console.log('Event tracked') })
66
}
77
88
function trackPageview() {
99
useTrackPageview()
1010
}
11+
12+
function pushRoute() {
13+
navigateTo('/about')
14+
}
1115
</script>
1216

1317
<template>
@@ -33,4 +37,16 @@ function trackPageview() {
3337
<button @click="trackEvent">useTrackEvent</button>
3438
&nbsp;
3539
<button @click="trackPageview">useTrackPageview</button>
40+
&nbsp;
41+
<button @click="pushRoute">navigateTo</button>
42+
43+
<h3>Links</h3>
44+
<ul>
45+
<li>
46+
<a href="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/nuxt-modules/plausible">Plausible (same page)</a>
47+
</li>
48+
<li>
49+
<a href="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/nuxt-modules/plausible" target="_blank">Plausible (another tab)</a>
50+
</li>
51+
</ul>
3652
</template>

playground/nuxt.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
export default defineNuxtConfig({
22
modules: ['../src/module.ts'],
33

4+
plausible: {
5+
autoPageviews: false,
6+
autoOutboundTracking: false,
7+
},
8+
49
typescript: {
510
typeCheck: 'build',
611
shim: false,

0 commit comments

Comments
 (0)