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