Add my site

Install on Astro

Two lines in your base layout's head covers every page Astro renders.

Takes about two minutes

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 layout's <head>, e.g. src/layouts/Layout.astro:

<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>

Astro's is:inline is not needed: the tag is an external script with attributes, which Astro leaves alone by default. If you use view transitions, navigations still count: the tag follows the History API.

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.