How to install SiteTrust Consent
Pick one path: first script in the head, or two GTM tags on Consent Initialization. Then prove default, accept, and decline.
The rule that never changes
consent-widget.js must run before Google Tag Manager, Google Analytics, Google Ads, Meta Pixel, chat widgets, and the Trust Badge. If something else speaks first, Consent Mode default is already late.
<script src="https://www.sitetrust.com/consent-widget.js"
data-configuration-id="YOUR_CONFIGURATION_ID">
</script>Path 1: install in the site head
Use this when you can edit <head> directly. Paste the Header snippet as the first script. Platform steps:
If the site already uses a header-code plugin, keep that plugin. Add SiteTrust at the top of the head field. You do not need a new plugin just for this script.
Path 2: install in Google Tag Manager
Use this when GTM is already the way tags enter the site. Create two Custom HTML tags, both on Consent Initialization — All Pages:
- SiteTrust — Consent Default fires
gtag('consent', 'default', …)with all four signals denied andwait_for_update: 500. - SiteTrust — Consent Widget loads
consent-widget.jswith your Configuration ID and is sequenced to fire after the default tag.
Do not also put consent-widget.js in the site head. Full walkthrough: Install via Google Tag Manager.
After it is live
- Open the published site in an Incognito window.
- Confirm the banner appears before you click anything.
- In Console, confirm a Consent Mode default with denied signals.
- Click Accept All. Confirm update with granted signals and that analytics is allowed to load.
- Repeat in a new Incognito window and click Decline. Confirm update with denied signals and that GA / ads do not load.
- Open Privacy Choices and confirm date, consent ID, and state.
- Run Site Audit in the Client Trust Center: Run A, then B, then C.
Detailed test steps: Test default, accept, and decline.
If you also want the Trust Badge
Add widget.js after the consent script. Floating badges go in the head. Inline badges go in the page body (footer is the usual place). See Combined consent and badge snippet.
Need help?
Email wecare@sitetrust.com with your site URL and platform. One business day response, Monday through Friday.