Skip to content

Commit

Permalink
feat: move to fork of plausible-analytics (#15)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Barbapapazes committed Feb 5, 2024
1 parent 40c62d6 commit 86f0e35
Show file tree
Hide file tree
Showing 10 changed files with 1,304 additions and 588 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
"release": "bumpp --commit --push --tag"
},
"dependencies": {
"@barbapapazes/plausible-tracker": "^0.2.2",
"@nuxt/kit": "^3.8.2",
"defu": "^6.1.3",
"pathe": "^1.1.1",
"plausible-tracker": "^0.3.8"
"pathe": "^1.1.1"
},
"devDependencies": {
"@nuxt/eslint-config": "^0.2.0",
Expand Down
18 changes: 17 additions & 1 deletion playground/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
const { plausible } = useRuntimeConfig().public
function trackEvent() {
useTrackEvent('playground')
useTrackEvent('playground', { props: { action: 'click' }, callback: () => console.log('Event tracked') })
}
function trackPageview() {
useTrackPageview()
}
function pushRoute() {
navigateTo('/about')
}
</script>

<template>
Expand All @@ -33,4 +37,16 @@ function trackPageview() {
<button @click="trackEvent">useTrackEvent</button>
&nbsp;
<button @click="trackPageview">useTrackPageview</button>
&nbsp;
<button @click="pushRoute">navigateTo</button>

<h3>Links</h3>
<ul>
<li>
<a href="https://github.com/nuxt-modules/plausible">Plausible (same page)</a>
</li>
<li>
<a href="https://github.com/nuxt-modules/plausible" target="_blank">Plausible (another tab)</a>
</li>
</ul>
</template>
5 changes: 5 additions & 0 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
export default defineNuxtConfig({
modules: ['../src/module.ts'],

plausible: {
autoPageviews: false,
autoOutboundTracking: false,
},

typescript: {
typeCheck: 'build',
shim: false,
Expand Down

0 comments on commit 86f0e35

Please sign in to comment.