Install with Google Tag Manager
Load the tag through Custom HTML and pass through your visitor's analytics consent, including withdrawal.
Where the tag goes
Copy the snippet from your dashboard and add
data-require-consent, as below. The
data-site-id identifies the installation. Verify ownership
with the DNS TXT record on
Verify your domain,
because a meta tag added through Tag Manager is not in the
server-rendered HTML that the ownership check reads.
In Tag Manager: create a Custom HTML tag, paste the
snippet from your dashboard with data-require-consent
added, as below, and set its load trigger. Loading it on
All Pages still leaves measurement waiting for a grant.
Connect your consent manager before publishing: it must call
ds("consent", "granted") for acceptance and
ds("consent", "denied") for withdrawal. Blocking later
tag fires does not stop an already-running script. The
queue stub and consent callbacks
cover initial and saved choices.
<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" data-require-consent></script>Verify it worked
Open your site from a different network than the one you use for the dashboard (your phone with Wi-Fi off works), accept analytics 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. Withdraw consent and check that no further measurement requests leave the page. The installation step on your dashboard detects the first recorded pageview. Ownership comes from the DNS TXT record, not from this 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.