Documentation
Percepto installs in 60 seconds. Paste one script tag, configure your client ID, and Percepto handles the rest - visitor scoring, voice conversation, lead capture, and CRM sync.
Installation
Paste this script tag before the closing </body> tag on any page where you want Percepto active.
https://api.perceptoai.comReplace
your_client_id with the client ID from your Percepto dashboard.
B2B — converts visitors into demo bookings
B2C — converts visitors into purchases
That is it. Percepto will automatically score the visitor, speak a personalised opening line, and handle the conversation.
B2B vs B2C mode
The data-scout-mode attribute controls Scout's goal and conversation strategy:
| Mode | Goal | CTA Percepto works toward |
|---|---|---|
| b2b | Book a demo call | Calendar booking link |
| b2c | Drive purchase | Shop / checkout page |
Percepto auto-detects enterprise vs SMB within B2B mode from conversation signals - compliance questions, team size, budget language. You never need to configure this. Use flow_override in your client config to hard-set if needed.
Widget attributes
All configuration is passed as data- attributes on the script tag. No JavaScript required.
| Attribute | Default | Description |
|---|---|---|
| data-scout-api | required | Your Percepto API endpoint. E.g. https://api.perceptoai.com |
| data-scout-mode | "b2b" |
Conversation mode: "b2b" (demo booking) or "b2c" (purchase). |
| data-scout-client-id | required | Your unique client ID from the Percepto dashboard. Determines which voice, prompts, and CRM config are used. |
| data-scout-input | "voice" |
Input mode: "voice" (microphone) or "chat" (typed text). |
| data-scout-trigger | "delay" |
When Scout activates: "delay" (after N ms) or "manual" (call window.__scout.open()). |
| data-scout-delay | "5000" |
Milliseconds before Percepto auto-opens when trigger="delay". Set "0" for immediate. |
| data-scout-sitemap | "{}" |
JSON map of page labels to URLs Percepto can navigate to. Used for CTA navigation actions. See Sitemap config. |
Trigger modes
Delay trigger (recommended)
Scout opens automatically after the visitor has been on the page for data-scout-delay milliseconds. Best for most sites — gives the visitor a moment to orient before Scout speaks.
Manual trigger
Scout loads silently and waits. Call window.__scout.open() from your own code — useful for button clicks, exit-intent, or scroll triggers.
Sitemap config
data-scout-sitemap is a JSON map that tells Scout which pages it can navigate a visitor to. When Scout decides it's time to move a visitor to the demo page or checkout, it returns an action: "navigate" with the URL from this map.
Keys are human-readable labels Percepto references in its reasoning. Values are absolute URL paths on your site. At minimum include your primary CTA destination ("demo" for B2B, "shop" or "checkout" for B2C).
Consent & privacy
Percepto is built for GDPR, DPDP (India), and UAE PDPL compliance. The widget checks for consent before collecting any visitor data.
How consent works
Scout reads localStorage.getItem('scout_consent') before running:
'accepted'— Percepto activates normally.'rejected'— Percepto stays silent. No data collected.- null / not set — Percepto also stays silent until consent is given.
Adding a consent banner to your site
You must show a consent banner before Percepto activates. Set consent in localStorage from your banner's Accept/Decline buttons:
/prelaunch. See Privacy Policy and Terms of Service for the full legal framework.
GET /health
Returns service status. Use for uptime monitoring and pre-deploy smoke tests.
Response
POST /intelligence/score
Scores a visitor's intent from browser and IP signals, then returns a personalised opening line. Called automatically by the widget on every page load.
Request body
| Field | Type | Description |
|---|---|---|
| visitor_id | string required | First-party cookie value (_scout_vid, format: sv_<random><ts>) |
| mode | string required | "b2b" or "b2c" |
| landing_page | string optional | Current page path, e.g. "/pricing" |
| referrer | string optional | HTTP Referer header value |
| utm_source | string optional | UTM source from query string |
| utm_campaign | string optional | UTM campaign from query string |
| browser_locale | string optional | e.g. "en-US" |
| device_type | string optional | "desktop", "mobile", or "tablet" |
| hour_of_day | integer optional | 0–23 in visitor's local time |
| day_of_week | integer optional | 0=Monday … 6=Sunday |
| client_id | string optional | Your client ID — enables per-client voice and prompt config |
Response
POST /session/start
Creates a conversation session in Redis, seeded with the visitor's intent context and opening line. Returns a session_id used for all subsequent turns.
Request body
| Field | Type | Description |
|---|---|---|
| visitor_id | string required | Must match the visitor_id used in /intelligence/score |
| client_id | string required | Your client ID |
| mode | string required | "b2b" or "b2c" |
| opening_line | string optional | Opening line returned by /intelligence/score |
| context_summary | string optional | Context summary returned by /intelligence/score |
| intent_level | string optional | Intent level from /intelligence/score |
| visitor_type | string optional | Visitor type from /intelligence/score |
| opening_strategy | string optional | Opening strategy from /intelligence/score |
Response
POST /conversation/turn
Processes one conversation turn. Accepts the visitor's message (text or transcribed speech), returns Percepto's reply and optional navigation action. Percepto selects enterprise or SMB flow automatically based on conversation signals.
Request body
| Field | Type | Description |
|---|---|---|
| session_id | string required | Session ID returned by /session/start |
| message | string required | Visitor's message text (plain text or speech transcript) |
Response
action is "navigate", the widget automatically navigates the visitor to nav_url after reading the reply. No extra code needed — it's handled by scout.js.
POST /voice/transcribe
Accepts audio chunks from the browser (WebM/WAV format), transcribes using Groq Whisper, extracts voice signals via librosa, and returns the transcript. Called automatically by the widget when input mode is "voice".
Request
Multipart form data with an audio field containing the audio file (WebM or WAV).
Response
POST /voice/speak
Converts text to speech using ElevenLabs and streams audio back. Uses the per-client voice_id stored in Supabase (configured during onboarding).
Request body
| Field | Type | Description |
|---|---|---|
| text | string required | Text to synthesise |
| client_id | string optional | Uses per-client voice ID if provided |
Returns an audio stream (audio/mpeg). The widget plays it directly in the browser.
Slack alerts
Percepto fires a Slack alert when a high-intent visitor is detected (or on every session, depending on your config). Set these two environment variables on your Percepto backend:
Get a Webhook URL from your Slack App settings → Incoming Webhooks. Percepto sends a rich message with visitor company, intent level, page, and a Claim link for human handoff.
HubSpot & Salesforce
Percepto pushes a lead summary to your CRM automatically at the end of each high-intent conversation. Configure during onboarding or via the dashboard:
- HubSpot — requires your HubSpot Private App token. Percepto creates or updates a Contact with name, email, company, and extracted pain points.
- Salesforce — requires OAuth2 credentials. Percepto creates a Lead record with the same fields.
CRM push is included in the Growth plan and above.
Content crawl (RAG)
Percepto crawls your website and indexes your content into a vector store so its answers are grounded in your actual product, pricing, and case studies.
Crawls are also triggered automatically when you update your website URL in the dashboard. Content is chunked, embedded, and stored in Supabase pgvector under your client ID.
Visitor signals
Percepto collects 15+ signals before the first word is spoken. These power the intent score and personalised opening line.
IP intelligence
The backend enriches every request with IP-derived data — company name, city, and country — via ip-api.com (1,000 req/day free, no key needed). This lets Percepto open with "I see you're coming from Stripe in San Francisco" when confidence is high.
Returning visitor memory
Visit history is stored in Upstash Redis under visitor:{visitor_id} with a 30-day TTL. On each return, Percepto reads the previous intent level and last page, then adjusts tone — warmer for cold returners, more direct for high-intent ones.
Conversation flows
Percepto uses two pre-built conversation flows that reduce LLM calls for predictable paths. Flow selection is automatic — based on signals detected in real-time:
Enterprise flow
Triggered when Percepto detects: compliance questions, large team mentions, multi-stakeholder language, procurement signals, or long evaluation timelines.
- 6–8 turns
- Deep discovery: pain points, team structure, current tools, timeline
- CTA: schedule a discovery call with an AE
SMB flow
Default for smaller teams and individual buyers.
- 3–4 turns
- Fast qualification + product fit
- CTA: start a free trial or book a quick demo
flow_override: "enterprise" | "smb" in their client config in Supabase. Percepto will skip auto-detection and use the specified flow.
Troubleshooting
Percepto doesn't appear on my site
Check in order:
- Open browser DevTools → Console. Look for errors from
scout.js. - Check that
data-scout-apiis set and the URL is reachable. Test:curl https://your-api/health. - Check
localStorage.getItem('scout_consent')in the browser console. If it's'rejected'or null, Scout won't load. Either show a consent banner or set it to'accepted'for testing. - Confirm
data-scout-client-idmatches a client record in Supabase. - If
data-scout-trigger="delay", wait fordata-scout-delayms after page load.
Percepto loads but voice doesn't work
- Check that the browser has been granted microphone permission.
- Ensure
ELEVENLABS_API_KEYis set on your backend and the client has avoice_idconfigured. - Try
data-scout-input="chat"to confirm the conversation loop works without voice.
Percepto replies don't mention my product
Run a content crawl so Percepto's answers are grounded in your actual site. See Content crawl (RAG).
CRM push isn't working
Verify your HubSpot token or Salesforce OAuth credentials in the Percepto dashboard. CRM push requires the Growth plan or above. Check the /crm/summaries/{client_id} endpoint to confirm summaries are being generated.
Testing without real visitors
Use the Percepto test page at /test on your backend. It loads Percepto with trigger=immediate and client_id=demo so you can have a full conversation without any real traffic.
localStorage.setItem('scout_consent', 'accepted') in your browser console first — Scout won't run without consent, even locally.