React Router now covers everything from a client-side router to a full-stack framework, the successor to Remix. Where Reveata goes depends on which of those you use; what it gives you is the same.
What you get
- Every route counted through the History API, with no code in route components. Changes to the query string alone (
?tab=2) are not new pages. - Form goals on React Router's
<Form>, which renders a regular form: the goal counts on submit, even though React Router handles the submission. - Revenue attribution from actions that start checkouts.
- First-party serving through the managed proxy, your Express server or your host's rewrites.
Where the tag goes
| How you use React Router | File |
|---|---|
Framework mode (React Router 7 with react-router.config.ts, including Remix apps moved to it) |
The Layout in app/root.tsx |
| Declarative or data mode in a Vite app | index.html at the project root |
Hash routing (createHashRouter) |
Either of the above, with data-hash="true" |
Framework mode works with server rendering and with ssr: false, because both render root.tsx into the HTML. Don't render the tag inside a route component: it would be added on every navigation. React Router's modes are explained at reactrouter.com (opens in a new tab).
Linking payments to visits
In framework mode a checkout usually starts in an action. Send the ids with the form from the browser (window.reveata.metadata() into hidden inputs), then add them to the checkout metadata on the server, for example a Stripe Checkout Session's metadata.reveata_visitor_id (Stripe Checkout attribution). If Reveata doesn't connect to your provider, send each payment from the action with the Payments API, but never both for the same provider.
Serving the script from your own domain
- The managed proxy: one DNS record, any deployment.
- Your own Express server with
@react-router/express: add the two Reveata routes before the request handler (Express analytics). - A single-page app on a static host: the host's rewrites (proxy through your own server).