Embedding on Your Website
Add Opally's search widget to your website with a single line of code. Choose between an inline search field or a modal search dialog.
Quick Start
Add this script tag to your website where you want the search widget to appear:
<script
src="https://app.opally.com/embed/opally-search.js"
data-company-id="YOUR_COMPANY_ID"
async
></script>The search field will appear exactly where you place the script tag.
Getting Your Embed Code
Log in to app.opally.com
Go to Chat (in the sidebar)
Select the Implementation tab
Click on Search Widget at the top
Customize the widget appearance (colors, font, border radius)
Choose your variant (Inline or Modal)
Copy the pre-generated script tag
Paste it into your website
Widget Variants
Inline Field (Default)
Embeds a search input field directly where you place the script. Best for:
Header/navigation areas
Dedicated search pages
FAQ or help center sections
Modal
Shows a search button that opens a full search dialog when clicked. Supports keyboard shortcut (Cmd+K / Ctrl+K). Best for:
Minimal header designs
Pages where space is limited
Power-user interfaces
Customization Options
Customize the widget appearance using data attributes:
Available Options
data-company-id
Your Opally company ID (required)
–
data-variant
Display mode: inline or modal
inline
data-primary
Primary accent color (hex)
#0052cc
data-font
Font family
System fonts
data-radius
Border radius in pixels
12
data-bg
Background color (hex)
#ffffff
data-text
Text color (hex)
#1f2937
data-mode
Color mode: light, dark, or auto
light
data-show-chat-link
Show "Chat with us" link: true or false
true
Styling Examples
Dark Mode
Rounded Design
Match Your Brand
Supported Fonts
The following Google Fonts are supported:
Inter
Roboto
Poppins
Lato
Source Sans 3
Platform-Specific Instructions
WordPress
Option 1: Theme Footer
Go to Appearance > Theme Editor
Find the template where you want the search (e.g.,
header.php)Add the script where you want the search to appear
Save changes
Option 2: Widget
Install a plugin like "Custom HTML Widget"
Add the widget to your desired location
Paste the script code
Save
Squarespace
Go to Pages and select the page
Add a Code block where you want the search
Paste the script
Save and publish
Wix
Go to Settings > Custom Code
Click + Add Custom Code
Paste the script
Set placement to Body - start (or specific location)
Apply to desired pages
Save
Webflow
Select the element where you want the search
Add an Embed component
Paste the script code
Save and publish
Shopify
Go to Online Store > Themes
Click Actions > Edit code
Find the template where you want the search
Add the script at the desired location
Save
Custom HTML/React/Next.js
Add the script tag to your HTML template or use a React component:
Behavior Options
AI Answers
By default, the search widget generates AI-powered answers from your indexed content. You can enable/disable this in the Opally dashboard under Chat > Implementation > Search Widget.
Chat Escalation
The "Can't find it? Chat with us" link appears at the bottom of search results. When clicked, it opens the Opally chatbot (if also embedded) or navigates to a specified chat URL.
To hide the chat escalation link:
Recent Searches
The widget remembers recent searches per visitor (stored in localStorage). Recent searches appear when focusing on an empty search field.
Troubleshooting
Widget not appearing
Check script placement – The widget appears exactly where the script is placed
Verify Company ID – Make sure the ID matches your Opally account
Check allowed origins – Your website must be added to allowed origins in Opally
Clear cache – Try hard refresh (Ctrl+Shift+R or Cmd+Shift+R)
No search results
Check sitemap indexing – Ensure your sitemap is indexed in Opally
Wait for indexing – New content may take time to be indexed
Verify content – The search only returns content from indexed pages
Styling conflicts
The widget uses Shadow DOM to prevent style conflicts. If issues persist:
Check for aggressive global styles on your site
Try adjusting the
data-modeattributeContact support if issues continue
Mobile display issues
The widget is fully responsive:
Results dropdown adapts to screen size
Touch-friendly interface
Prevents iOS zoom on input focus
Best Practices
Do:
Place prominently – Put the search where visitors expect it (header, help section)
Match your brand – Use colors and fonts that fit your design
Keep sitemap updated – Regularly re-index to include new content
Test on mobile – Ensure the widget works well on all devices
Don't:
Hide the widget – Make sure it's easily discoverable
Use conflicting colors – Ensure sufficient contrast for accessibility
Forget mobile testing – Always test on actual devices
Need Help?
If you have trouble embedding the widget:
Email: info@opally.com
In-app support: Log in to Opally and use the help chat
Last updated