Embed Widget
Add SeekWhy surveys to any website with a simple JavaScript snippet. Collect feedback directly on your site without redirecting users.
Quick Start
<script>
(function(w,d,s,o,f,js,fjs){
w['SeekWhyWidget']=o;w[o]=w[o]||function(){
(w[o].q=w[o].q||[]).push(arguments)
};
js=d.createElement(s);fjs=d.getElementsByTagName(s)[0];
js.id='seekwhy-widget';js.src=f;js.async=1;
fjs.parentNode.insertBefore(js,fjs);
}(window,document,'script','seekwhy',
'https://seekwhy.ai/widget/embed.js'));
seekwhy('init', 'YOUR_SURVEY_TOKEN');
</script>Getting Your Survey Token
- Go to your SeekWhy dashboard
- Open the survey you want to embed
- Navigate to the Share & Embed tab
- Copy the embed code or survey token
Display Modes
Choose how the survey appears on your website. Each mode is optimized for different use cases.
Popup Mode (Default)
A centered modal overlay that focuses attention on the survey. Best for important feedback collection.
seekwhy('init', 'TOKEN', { mode: 'popup' });Bubble Mode
A floating chat bubble (like Intercom) that stays in the corner. Clicking opens a chat-style window above the bubble. Non-intrusive and always accessible.
seekwhy('init', 'TOKEN', {
mode: 'bubble',
position: 'bottom-right'
});Slide-in Mode
A side panel that slides in from the edge of the screen. Good for longer surveys or when you need more space.
seekwhy('init', 'TOKEN', {
mode: 'slide_in',
position: 'bottom-right'
});Inline Mode
Embeds the survey directly into your page content. Perfect for dedicated feedback sections or landing pages.
<!-- HTML -->
<div id="survey-container"></div>
<!-- JavaScript -->
seekwhy('init', 'TOKEN', {
mode: 'inline',
container: '#survey-container'
});Trigger Options
Control when the survey appears to your visitors.
Immediate (Default)
Opens automatically when the page loads.
trigger: 'immediate'Delay
Opens after a specified number of seconds.
trigger: 'delay', delay: 10Scroll
Opens when the user scrolls a percentage of the page.
trigger: 'scroll', scrollPercent: 50Exit Intent
Opens when the user moves cursor to close the browser (desktop only).
trigger: 'exit_intent'Manual
Only opens when you call seekwhy('open') programmatically.
trigger: 'manual'Customization
| Option | Default | Description |
|---|---|---|
| mode | 'popup' | popup, bubble, slide_in, inline |
| trigger | 'immediate' | immediate, delay, scroll, exit_intent, manual |
| position | 'bottom-right' | bottom-right, bottom-left, top-right, top-left |
| container | null | CSS selector for inline mode |
| delay | 5 | Seconds for delay trigger |
| scrollPercent | 50 | Percentage for scroll trigger |
| primaryColor | '#FF1B8D' | Accent color (hex) |
| backgroundColor | '#FFFFFF' | Background color (hex) |
| showBranding | true | Show "Powered by SeekWhy" |
API Methods
seekwhy('open')Programmatically open the widget
seekwhy('close')Close the widget
seekwhy('destroy')Remove widget and clean up
seekwhy('on', event, callback)Listen to events: 'open', 'close', 'submit'
Complete Example
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<button id="feedback-btn">Give Feedback</button>
<!-- SeekWhy Widget -->
<script>
(function(w,d,s,o,f,js,fjs){
w['SeekWhyWidget']=o;
w[o]=w[o]||function(){(w[o].q=w[o].q||[]).push(arguments)};
js=d.createElement(s);fjs=d.getElementsByTagName(s)[0];
js.id='seekwhy-widget';js.src=f;js.async=1;
fjs.parentNode.insertBefore(js,fjs);
}(window,document,'script','seekwhy',
'https://seekwhy.ai/widget/embed.js'));
// Initialize with bubble mode
seekwhy('init', 'YOUR_TOKEN', {
mode: 'bubble',
position: 'bottom-right',
trigger: 'manual',
primaryColor: '#4F46E5'
});
// Open on button click
document.getElementById('feedback-btn')
.addEventListener('click', function() {
seekwhy('open');
});
// Listen for submissions
seekwhy('on', 'submit', function(answer) {
console.log('Feedback received!', answer);
});
</script>
</body>
</html>AI Follow-up Questions
Embedded surveys now support AI-powered follow-up questions. When a respondent gives a rating or short answer, AI can automatically ask clarifying questions to understand the "why" behind their response.
Note: AI follow-ups must be enabled both on the survey settings and on individual questions.
Smart Conversations
AI asks up to 3 contextual follow-up questions per survey question. It automatically stops when it has enough detail.
Skip Option
Respondents can always skip follow-up questions. The survey continues normally even if they choose not to elaborate.
Privacy Aware
AI conversations are stored securely. You can choose whether to include them in reports or keep them anonymized.
Branching Logic
Embedded surveys fully support conditional branching. Show or skip questions based on previous answers, create personalized survey paths, and end surveys early when appropriate.
Supported Conditions:
Supported Actions:
Example: NPS Branching
Create different follow-up paths for promoters, passives, and detractors:
- • Promoters (9-10) → "What do you love most about us?"
- • Passives (7-8) → "What would make you more likely to recommend us?"
- • Detractors (0-6) → "What went wrong? How can we fix it?"
Performance & Reliability
Non-blocking
The script loads asynchronously and never blocks your page from rendering.
Fail-safe
If SeekWhy servers are slow or unavailable, your site works perfectly—the widget simply won't appear. No errors, no broken pages.
Lightweight
Only ~15KB minified. Pure JavaScript with no external dependencies.
Test Your Integration
Use our embed demo page to test different configurations before adding the widget to your site:
Open Embed Demo