@@ -28,6 +28,9 @@ import BlogDate from "./components/BlogDate.vue";
2828import BlogIndex from "./components/BlogIndex.vue" ;
2929import ProfileCard from "./components/ProfileCard.vue" ;
3030
31+ // Import Matomo analytics (replaces vuepress-plugin-matomo)
32+ import { initMatomo } from "./utils/matomo.js" ;
33+
3134export default defineClientConfig ( {
3235 enhance ( { app, router, siteData } ) {
3336 // Create Vuetify instance with only the components we use
@@ -65,35 +68,8 @@ export default defineClientConfig({
6568 app . component ( "BlogIndex" , BlogIndex ) ;
6669 app . component ( "ProfileCard" , ProfileCard ) ;
6770
68- // Initialize Matomo Analytics (client-side only)
69- if ( typeof window !== "undefined" ) {
70- // Matomo tracking code
71- window . _paq = window . _paq || [ ] ;
72- window . _paq . push ( [ "trackPageView" ] ) ;
73- window . _paq . push ( [ "enableLinkTracking" ] ) ;
74-
75- ( function ( ) {
76- var u = "https://p.bekerle.com/" ;
77- window . _paq . push ( [ "setTrackerUrl" , u + "matomo.php" ] ) ;
78- window . _paq . push ( [ "setSiteId" , "7" ] ) ;
79-
80- var d = document ;
81- var g = d . createElement ( "script" ) ;
82- var s = d . getElementsByTagName ( "script" ) [ 0 ] ;
83- g . async = true ;
84- g . src = u + "matomo.js" ;
85- s . parentNode . insertBefore ( g , s ) ;
86- } ) ( ) ;
87-
88- // Track page changes on route navigation
89- router . afterEach ( ( to ) => {
90- if ( window . _paq ) {
91- window . _paq . push ( [ "setCustomUrl" , window . location . href ] ) ;
92- window . _paq . push ( [ "setDocumentTitle" , document . title ] ) ;
93- window . _paq . push ( [ "trackPageView" ] ) ;
94- }
95- } ) ;
96- }
71+ // Initialize Matomo Analytics (replaces vuepress-plugin-matomo)
72+ initMatomo ( router ) ;
9773 } ,
9874 setup ( ) { } ,
9975 rootComponents : [ ] ,
0 commit comments