Install Piqo with React Router

One snippet in index.html plus a tiny hook for client-side route changes.

  1. Paste the snippet into public/index.html inside the <head>.
  2. Add a useLocation effect at the root of your app to fire pageviews on route change.
  3. Rebuild and deploy.
<!-- public/index.html -->
<script defer data-site="YOUR_SITE_ID" src="https://piqo.app/piqo.js"></script>
// src/App.jsx
import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';

function PageviewTracker() {
  const location = useLocation();
  useEffect(() => {
    window.piqo && window.piqo('pageview');
  }, [location.pathname, location.search]);
  return null;
}

export default function App() {
  return (
    <>
      <PageviewTracker />
      {/* ...your routes */}
    </>
  );
}
Initial page load: already covered by the script itself — the first pageview fires the moment Piqo loads.