@@ -20,15 +20,18 @@ export default function MatomoTracking(): JSX.Element | null {
2020
2121 // Initialize Matomo tracking
2222 const initializeMatomo = ( ) => {
23- const u = "//piwik-prod-www .oicr.on.ca/piwik/" ;
24- _paq . push ( [ 'setTrackerUrl' , u + 'matomo .php' ] ) ;
23+ const u = "https://webstats .oicr.on.ca/piwik/" ;
24+ _paq . push ( [ 'setTrackerUrl' , u + 'piwik .php' ] ) ; // Using piwik.php instead of matomo.php
2525 _paq . push ( [ 'setSiteId' , '76' ] ) ;
2626
2727 const d = document ;
2828 const g = d . createElement ( 'script' ) ;
2929 const s = d . getElementsByTagName ( 'script' ) [ 0 ] ;
3030 g . async = true ;
31- g . src = u + 'matomo.js' ;
31+ g . src = u + 'piwik.js' ; // Using piwik.js instead of matomo.js
32+ g . onerror = ( ) => {
33+ console . error ( 'Failed to load Matomo tracking script' ) ;
34+ } ;
3235 if ( s . parentNode ) {
3336 s . parentNode . insertBefore ( g , s ) ;
3437 }
@@ -38,7 +41,7 @@ export default function MatomoTracking(): JSX.Element | null {
3841 const trackPageView = ( ) => {
3942 _paq . push ( [ "setCookieDomain" , "*.overture.bio" ] ) ;
4043 _paq . push ( [ 'setDocumentTitle' , document . title ] ) ;
41- _paq . push ( [ 'setCustomUrl' , location . pathname + location . search ] ) ; // Include search parameters
44+ _paq . push ( [ 'setCustomUrl' , location . pathname + location . search ] ) ;
4245 _paq . push ( [ 'trackPageView' ] ) ;
4346 _paq . push ( [ 'enableLinkTracking' ] ) ;
4447 } ;
@@ -51,11 +54,7 @@ export default function MatomoTracking(): JSX.Element | null {
5154 // Track the current page
5255 trackPageView ( ) ;
5356
54- // Cleanup function
55- return ( ) => {
56- // Clean up any necessary listeners
57- } ;
58- } , [ location ] ) ; // Re-run effect when location changes
57+ } , [ location ] ) ;
5958
6059 return null ;
6160}
0 commit comments