Install on React
For a Vite, Create React App, or any other single-page React build: two lines in index.html, and routes track themselves.
Where the tag goes
Copy the exact code from your dashboard. It has two lines: a
verification meta line and the script tag. Paste both lines together
in your site's <head>. Check installation
then finds the tag and confirms you own the domain in one step. If you
can't edit the <head>, use the DNS TXT record on
Verify your domain instead.
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>:
<meta name="datastated-site-verification" content="YOUR_TOKEN">
<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 from a different network than the one you use for the dashboard (your phone with Wi-Fi off works) and click around. By default, DataStated leaves out visits from any IPv6 network you or a teammate opened the dashboard on, and visits from cloud servers, including many VPNs. The installation step on your dashboard detects the first recorded pageview and confirms you own the domain. 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.