File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
govtool/frontend/src/hooks Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ import { useEffect } from "react";
77
88export const useMatomo = ( ) => {
99 useEffect ( ( ) => {
10- const env = import . meta . env . VITE_APP_ENV ;
11- if ( env !== "production" || env !== "staging" ) {
12- return ;
13- }
10+ const isSancho = window . location . href . includes ( "sancho" ) ;
11+ if ( isSancho ) return ;
12+
13+ const network = import . meta . env . VITE_NETWORK_FLAG ;
1414 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1515 // @ts -expect-error
1616 const _paq = ( window . _paq = window . _pag || [ ] ) ;
@@ -19,7 +19,7 @@ export const useMatomo = () => {
1919 ( function ( ) {
2020 const u = "//analytics.gov.tools/" ;
2121 _paq . push ( [ "setTrackerUrl" , u + "matomo.php" ] ) ;
22- _paq . push ( [ "setSiteId" , env === "production" ? "1" : "2" ] ) ;
22+ _paq . push ( [ "setSiteId" , network === 1 ? "1" : "2" ] ) ;
2323 const d = document ;
2424 const g = d . createElement ( "script" ) ;
2525 const s = d . getElementsByTagName ( "script" ) [ 0 ] ;
You can’t perform that action at this time.
0 commit comments