AI Agent Integration Guide
Secure Privacy CMP Integration
Section titled “Secure Privacy CMP Integration”Quick Start
Section titled “Quick Start”- 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
What An AI Agent Should Do
Section titled “What An AI Agent Should Do”- 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
Copy-Paste Snippet
Section titled “Copy-Paste Snippet”<!-- 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>Framework Examples
Section titled “Framework Examples”Plain HTML
Section titled “Plain HTML”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>Next.js
Section titled “Next.js”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>.
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.
Pages Router (/pages directory)
Section titled “Pages Router (/pages directory)”Add the script in pages/_document.tsx inside <Head>.
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> )}React (Vanilla/CRA)
Section titled “React (Vanilla/CRA)”Add the script to public/index.html inside <head>.
<!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>Angular
Section titled “Angular”Add the script to src/index.html inside <head>.
<head> <meta charset="utf-8" /> <title>Angular App</title> <script src="https://app.secureprivacy.ai/script/692661ce204ddcd2e105cd1e.js"></script></head>WordPress
Section titled “WordPress”- Use a headers/footers plugin or edit your theme’s
header.phpto 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>Verification Checklist
Section titled “Verification Checklist”- 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.
Agent Prompt Examples
Section titled “Agent Prompt Examples”- “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.jsis ready for production use. Do not replace it with placeholders. - If you use a strict Content Security Policy (CSP), allow
https://app.secureprivacy.aiforscript-src.
Troubleshooting
Section titled “Troubleshooting”- 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.