Skip to content

Commit

Permalink
feat(plausible): Add Plausible
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Aug 23, 2024
1 parent c00ee42 commit 0029db1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
15 changes: 9 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@iconify-json/simple-icons": "1.1.114",
"@vitejs/plugin-vue": "5.1.2",
"autoprefixer": "10.4.20",
"plausible-tracker": "0.3.9",
"sass": "1.77.8",
"unplugin-auto-import": "0.18.2",
"unplugin-icons": "0.19.2",
Expand Down
1 change: 1 addition & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "./plugins/plausible";
import { createApp } from "vue";
import App from "./App.vue";
import router from "./plugins/router";
Expand Down
10 changes: 10 additions & 0 deletions src/plugins/plausible.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Plausible from "plausible-tracker";

export const plausible = Plausible({
apiHost: import.meta.env.VITE_PLAUSIBLE_HOST,
});

if (import.meta.env.VITE_PLAUSIBLE_HOST) {
plausible.enableAutoPageviews();
plausible.enableAutoOutboundTracking();
}

0 comments on commit 0029db1

Please sign in to comment.