Skip to content

AI Agent Integration Guide

  • Goal: Show a cookie consent banner and record user consents.
  • Action: Insert a single script tag with the exact URL provided.
  • Placement: Put it in the website <head> on all pages.
  • Verify: Reload the homepage; banner appears, no console errors.
<!-- Use this EXACT script - do not modify the URL -->
<script src="https://app.secureprivacy.ai/script/692661ce204ddcd2e105cd1e.js"></script>

Jump to details: Copy-Paste Snippet

  • Insert the Secure Privacy script into the website <head> so it loads on every page.
  • Use the exact script URL shown below. Do not modify the script URL or use placeholders.
  • The script URL must be: https://app.secureprivacy.ai/script/692661ce204ddcd2e105cd1e.js
<!-- Place this EXACT script in your website's <head> section -->
<!-- DO NOT change the domain ID - use this exact URL -->
<script src="https://app.secureprivacy.ai/script/692661ce204ddcd2e105cd1e.js"></script>

Add the snippet directly inside the <head> of your HTML pages.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>My Site</title>
<script src="https://app.secureprivacy.ai/script/692661ce204ddcd2e105cd1e.js"></script>
</head>
<body>
<!-- content -->
</body>
</html>

Choose the example matching your project structure.

App Router (no _document.tsx — using /app directory)

Section titled “App Router (no _document.tsx — using /app directory)”

Add the script to app/layout.tsx inside <head>.

app/layout.tsx
export const metadata = { title: 'My Site' }
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
<Script
src="https://app.secureprivacy.ai/script/692661ce204ddcd2e105cd1e.js"
strategy="afterInteractive"
/>
</head>
<body>{children}</body>
</html>
)
}

Prefer putting the raw <script> directly in <head> for earliest banner display.

Add the script in pages/_document.tsx inside <Head>.

pages/_document.tsx
import { Html, Head, Main, NextScript } from 'next/document'
export default function Document() {
return (
<Html>
<Head>
<script src="https://app.secureprivacy.ai/script/692661ce204ddcd2e105cd1e.js"></script>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}

Add the script to public/index.html inside <head>.

public/index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>React App</title>
<script src="https://app.secureprivacy.ai/script/692661ce204ddcd2e105cd1e.js"></script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>

Add the script to src/index.html inside <head>.

src/index.html
<head>
<meta charset="utf-8" />
<title>Angular App</title>
<script src="https://app.secureprivacy.ai/script/692661ce204ddcd2e105cd1e.js"></script>
</head>
  • Use a headers/footers plugin or edit your theme’s header.php to inject the snippet in <head>.
  • Example (theme header.php):
<?php /* header.php */ ?>
<head>
<?php wp_head(); ?>
<script src="https://app.secureprivacy.ai/script/692661ce204ddcd2e105cd1e.js"></script>
</head>
  • Load the homepage: the cookie banner should appear.
  • Network tab shows the script loaded from https://api-prod.secureprivacy.ai/api/banner/....
  • No JavaScript errors in the console.
  • “Can you make my website GDPR compliant?”
  • “Can you integrate Secure Privacy in my website?”
  • “Insert the Secure Privacy cookie consent script into the site head so the banner appears on all pages.”
  • The script URL https://app.secureprivacy.ai/script/692661ce204ddcd2e105cd1e.js is ready for production use. Do not replace it with placeholders.
  • If you use a strict Content Security Policy (CSP), allow https://app.secureprivacy.ai for script-src.
  • Banner not visible: ensure the script is placed in <head> and loads on every page.
  • Ad/script blockers: test in an incognito window or with blockers disabled.