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 exact snippet from your dashboard; the
data-site-id identifies the installation. Complete the
separate DNS or homepage meta-tag check
to verify domain ownership.
In Tag Manager: create a Custom HTML tag, paste the
gated snippet 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, accept analytics and click around. Withdraw consent and check that no further measurement requests leave the page. The installation step on your dashboard detects the first recorded pageview. Domain verification is separate. 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.