Install on custom HTML, Framer, and AI builders
Put consent-widget.js as the first script in the document head. Next.js, Framer, Lovable, v0, Bolt, and Cursor follow the same order.
Plain HTML
Open the shared layout or index.html. Paste the Header snippet as the first script inside <head>.
<!DOCTYPE html>
<html lang="en">
<head>
<script src="https://www.sitetrust.com/consent-widget.js"
data-configuration-id="YOUR_CONFIGURATION_ID">
</script>
<!-- GTM, GA4, pixels, and chat go after this -->
</head>
<body>
...
</body>
</html>Framer
Step 1. Open custom code
In the Framer project go to Site Settings → General → Custom Code.
Step 2. Start of head
Paste the SiteTrust script in Start of `<head>` tag, before other tracking scripts.
Step 3. Publish
Publish to the live domain and confirm the banner on that URL.
Next.js and other React apps
Put a plain <script> in the root layout <head> as the first child. Do not load SiteTrust with next/script afterInteractive or lazyOnload. Those strategies are too late.
For analytics you already have: remove them from unconditional load. Read localStorage key sitetrust_consent (JSON). Load GA, Meta, and similar tools only after analytics or marketing is true, or after a previous Accept on reload.
Lovable, v0, Bolt, and Cursor
Banner Setup can copy an AI-builder prompt that already contains your Configuration ID. Paste that prompt into the builder. The prompt tells the assistant to:
- Insert
consent-widget.jsas the first script in the root layout head. - Keep GTM, GA, Meta, and the Trust Badge after consent.
- Avoid
afterInteractive/lazyOnloadfor trackers. - Gate LeadConnector / GoHighLevel forms, booking iframes, and chat until
sitetrust_consentis stored. Those embeds often load Meta inside the iframe even when you never added a pixel.
Google Sites
Google Sites often blocks a true first-in-head script. If the banner never appears, move the site to a host that allows header scripts. Embeds are not a substitute.
After you publish
- Open the live URL in an Incognito window, not only the editor preview.
- Confirm the banner appears before any click.
- Accept once and Decline once in separate clean sessions.
- Follow Test default, accept, and decline.
- Run Site Audit in the Client Trust Center.
Need help?
Email wecare@sitetrust.com with your site URL and platform. One business day response, Monday through Friday.