import{normalizeRouteSlug as c}from"../../../../utils/path/normalize-route-slug.js";const p=({location:e},r)=>{const s=Object.keys(r?.analytics?.ga?.trackers||{});if(!s.length)return;const n=window.gtag;if(!n||typeof window.excludeGtagPaths<"u"&&window.excludeGtagPaths.some(t=>t.test(e.pathname)))return;const a=c(e.pathname),h=a+e.search+e.hash;for(const t of s)(t==="/"||a===t||a.startsWith(`${t}/`))&&n("event","page_view",{page_path:h,send_to:t})};export{p as onRouteChange};
