Install on React
For a Vite, Create React App, or any other single-page React build: one line in index.html, and routes track themselves.
Where the tag goes
Copy the exact snippet from your dashboard; the
data-site-id identifies the installation. Complete the
separate DNS or homepage meta-tag check described in
Get started to verify domain ownership.
This snippet starts measuring on load. Where consent is required, add data-require-consent before loading and wire acceptance and withdrawal to your consent manager. The consent guide includes the calls and pre-load queue.
Paste the tag into your index.html's <head>:
<script defer src="https://app.datastated.com/ds.js?v=2026-09-10-consent"
data-site="acme.com" data-site-id="dst_YOUR_SITE_ID"></script>
Route changes through React Router (or any router that uses the History
API) count as pageviews automatically. Repeated renders of the same
path are deliberately not double-counted. Hash-only routing
(/#/pricing) needs data-hash-routing="true" on the tag.
Verify it worked
Open your live site in a normal browser window and click around. The installation step on your dashboard detects the first recorded pageview. Domain verification is a separate step. Nothing arriving? Walk the troubleshooting list, and remember your own ad blocker or privacy flags silence the tag.
Questions? Email us at hello@datastated.com.