Skip to content

Commit

Permalink
Merge pull request #100 from BBMRI-ERIC/feat/implement_matomo_trackin…
Browse files Browse the repository at this point in the history
…g_to_app

add matomo tracking
  • Loading branch information
tmilost-bbmri-eric committed Feb 9, 2024
2 parents f900aca + 9b1f82f commit d2e0579
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"oidc-client-ts": "^2.1.0",
"sass-loader": "^13.2.0",
"vue": "^3.2.47",
"vue-matomo": "^4.2.0",
"vue-router": "^4.1.5",
"vue3-form-wizard": "^0.1.8",
"vuex": "^4.0.2",
Expand Down
6 changes: 6 additions & 0 deletions src/config/matomo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const matomo = {
matomoHost: "MATOMO_HOST_PLACEHOLDER",
matomoId: "MATOMO_SITE_ID_PLACEHOLDER"
}

export default matomo
9 changes: 8 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createApp } from "vue"
import App from "./App.vue"
import VueMatomo from 'vue-matomo'
import router from "./router"
import store from "./store"
import { sync } from "vuex-router-sync"
Expand All @@ -10,13 +11,17 @@ import "bootstrap/dist/css/bootstrap.css"
import "bootstrap-vue-next/dist/bootstrap-vue-next.css"
import "bootstrap"
import "bootstrap-icons/font/bootstrap-icons.css"
import matomo from "./config/matomo.js"

library.add(faSpinner)
library.add(faPencil)
library.add(faTrash)
library.add(faDownload)

const app = createApp(App)
const app = createApp(App).use(VueMatomo, {
host: matomo.matomoHost,
siteId: matomo.matomoId,
})

app.use(router)
app.use(store)
Expand All @@ -28,4 +33,6 @@ sync(store, router)

app.mount("#app")

window._paq.push(['trackPageView']); // To track a page view

import "./assets/scss/bbmri.scss"
2 changes: 2 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ do
sed -i 's|REDIRECT_URI_PLACEHOLDER|'${REDIRECT_URI}'|g' $file
sed -i 's|LOGOUT_URI_PLACEHOLDER|'${LOGOUT_URI}'|g' $file
sed -i 's|RESOURCES_PLACEHOLDER|'${API_RESOURCES}'|g' $file
sed -i 's|MATOMO_HOST_PLACEHOLDER|'${MATOMO_HOST}'|g' $file
sed -i 's|MATOMO_SITE_ID_PLACEHOLDER|'${MATOMO_SITE_ID}'|g' $file

done

Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6720,6 +6720,11 @@ vue-loader@^17.0.0:
hash-sum "^2.0.0"
watchpack "^2.4.0"

vue-matomo@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/vue-matomo/-/vue-matomo-4.2.0.tgz#d65e369e4ead1d95ef790bef3627512cac3d25e9"
integrity sha512-m5hCw7LH3wPDcERaF4sp/ojR9sEx7Rl8TpOyH/4jjQxMF2DuY/q5pO+i9o5Dx+BXLSa9+IQ0qhAbWYRyESQXmA==

vue-router@^4.1.5:
version "4.2.0"
resolved "https://registry.npmjs.org/vue-router/-/vue-router-4.2.0.tgz"
Expand Down

0 comments on commit d2e0579

Please sign in to comment.