Skip to content

Commit

Permalink
feat(tree): Track show Bergey's Manual clicks.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmussig committed Mar 28, 2023
1 parent f696eb9 commit 44d9af6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ export default {
domain: process.env.PLAUSIBLE_DOMAIN,
apiHost: process.env.PLAUSIBLE_API_HOST,
hashMode: false,
enableAutoOutboundTracking: true
enableAutoOutboundTracking: true,
trackLocalhost: false
}
},

Expand Down
7 changes: 7 additions & 0 deletions pages/tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@
dense
hide-details
label="Bergey's Manual"
@click="onShowBergeysUrl"
>
<template v-slot:append>
<TreePopUpBergeysHelp class="ml-3 my-auto"></TreePopUpBergeysHelp>
Expand Down Expand Up @@ -580,6 +581,12 @@ export default Vue.extend({
return this.openTreeToTaxon(this.$route.query.r.toString());
}
},
onShowBergeysUrl() {
if (this.showBergeysUrl) {
this.$plausible.trackEvent("Show Bergey's Manual");
}
},
},
mounted() {
this.$accessor.tree.initTreeState();
Expand Down
6 changes: 6 additions & 0 deletions plugins/vue-plausible.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Vue from 'vue'
import { VuePlausible } from 'vue-plausible'

Vue.use(VuePlausible, {
// see configuration section
})

0 comments on commit 44d9af6

Please sign in to comment.