Embedded Search & Results Page Builder
The Embedded Search Builder allows you to embed a full-featured, AI-powered search form and dynamic results page directly into any standard page on your website (e.g. /search, /kb, or /support).
1. Features & Capabilities
- Dedicated In-Page Search Form: Renders a search input field and submit button directly inside your page layout.
- Rich Result Cards: Displays product titles, AI-generated search excerpts, product prices, thumbnail images, and clickable "View Resource" action links.
- URL Parameter Capture: Automatically reads incoming search keywords from URL query parameters (e.g.
https://yoursite.com/search-results?s=wireless+headphones), performing the search immediately when the page loads. - Dynamic "Load More" Pagination: Seamlessly loads subsequent batches of results without reloading the entire web page.
- Embedded Live Search: Optionally attaches instant autocomplete dropdown suggestions directly to the embedded search bar.
- Search Results Memory: Remembers the visitor's last query and results using
localStorage. When a user clicks a result and then presses the browser Back button, results are instantly restored — no API call needed. - Multi-Language Support: Translates all search headings, button labels, and error messages to match the visitor's language.
2. Customizing Embedded Search
Navigate to the Embedded Search section (section=embeddedsearch) on your dashboard.
Subtab 1: Search Settings & Results Display
┌─────────────────────────────────────────────────────────────────────────────┐
│ Target Container Class: "sbpro-embedded-container" │
│ Incoming Keyword URL Param: "s" │
│ Results Header Label: "Search Results for: " │
│ Results Per Page: 10 │
│ Max Total Results: 50 │
│ Results "More Info" Link: "View Resource" │
│ Results "Price" Label: "Price: " │
│ "Show More Results" Button: "Load More Results" │
└─────────────────────────────────────────────────────────────────────────────┘
- Target Container Class: The CSS class name of the
<div>where the embedded search component will render on your page (defaultsbpro-embedded-container). - Current Search Field "Name" (Incoming Query): The URL query string parameter used by your site when visitors submit a search form (e.g.
sfor?s=keywordon WordPress, orqfor?q=keywordon Shopify). - Show/Hide Search Field: Choose whether to render the search input box on the page or only display the results list (useful if your page already has a custom search bar).
- Search Placeholder & Submit Label: Customize the input placeholder text (e.g.
"Search knowledge base...") and submit button label (e.g."Search"). - Results Header Label: Prefix shown above the results list (e.g.
"Search Results for: "+ visitor query). - Results Per Page & Max Limit: Control how many result cards display initially (e.g.
10) and the maximum total records returned (e.g.50). - Results "More Info" & "Price" Labels:
- More Info Link: Text on the button linking to the product or article (e.g.
"View Resource"or"Buy Now"). - Price Label: Text prefix shown before prices (e.g.
"Price: "or"MSRP: ").
- More Info Link: Text on the button linking to the product or article (e.g.
- Thumbnail Images in Search Results:
- Toggle On/Off: Enable to display product thumbnails on each card.
- Custom Placeholder: Upload an alternate fallback image if a product doesn't have a photo.
- Error & Status Messages: Customize the text for "Please enter at least 3 characters" and "No results found matching your search query."
2: Search Results Memory (Back-Button Persistence)
When a visitor performs a search, clicks a result link, and then presses the browser Back button, the embedded search widget automatically restores their previous search — instantly — without making a new API request.
How It Works
After every successful search, the widget saves the following to the visitor's browser localStorage, namespaced to your specific dataset so multiple embedded search instances never conflict:
| Saved Item | localStorage Key | Description |
|---|---|---|
| Search Query | vspy_em_query_{apiKey} | The visitor's last search term, pre-filled into the input on restore. |
| Results HTML | vspy_em_html_{apiKey} | The rendered result cards injected instantly without re-fetching. |
| Results Header | vspy_em_header_{apiKey} | The "Search Results for: query" header text above the cards. |
| Scroll Position | vspy_em_scroll_{apiKey} | Restores the page scroll position to exactly where the visitor was. |
| Expiry Timestamp | vspy_em_ttl_{apiKey} | 30-minute TTL — expired state is automatically discarded on next visit. |
Restore Logic & Priority Rules
On every page load, the widget checks for a URL search parameter first. Memory is only restored when no URL query is present:
Page loads
│
├─ URL param present? (e.g. ?s=shoes)
│ └─► YES: Run fresh search. Clear any saved memory state.
│
└─ No URL param (e.g. Back button navigation)
├─► Memory exists & within 30-min TTL?
│ └─► YES: Restore query + results + scroll instantly (0 API calls)
└─► Memory expired or empty → Show blank search form
When Memory Is Automatically Cleared
- The visitor types a new search query and clicks Search or presses Enter.
- The 30-minute TTL has elapsed since the last search.
- The page is loaded with an explicit URL query parameter (e.g.
?s=shoes).
localStorage, the back-button restore is instantaneous and does not count against your API quota.Enabling or Disabling Memory
The toggle is located in the Embedded Search Builder dashboard under Results Display & Pagination Settings → 🧠 Search Results Memory (Back-Button Persistence). It is Enabled by default for all datasets. To disable it, set the dropdown to Disabled and save — the widget will revert to standard stateless behavior.
CSS Stylesheets & Classes
Visperity automatically compiles clean CSS classes for the embedded search form, buttons, and result cards:
.sbpro-embedded-container: The outer container..sbpro-results-list-item: Individual result cards..sbpro-results-list-title: Product and article titles..sbpro-results-list-price: Product price badges..sbpro-results-list-excerpt: AI summary text..sbpro-results-more-info: The action link button.
You can add custom CSS rules directly in the Custom CSS box to customize borders, fonts, or shadows.
Multi-Language Translations
- Select a secondary language from the dropdown (e.g.
🇫🇷 French). - Click ✨ AI Auto-Translate to automatically translate all form placeholders, search headings, error messages, and price labels.
- Click 💾 Save Translations.
3. Installing on Your Website
Installing Embedded Search requires placing a target <div> on your page and including the JavaScript embed tag:
- In your CMS or HTML page template (e.g. on your
/search-resultsor/helppage), add the container<div>:
<!-- Container where search form and results will appear -->
<div class="sbpro-embedded-container"></div>
- Add the Visperity Embedded Search
<script>tag right before the closing</body>tag:
<!-- Visperity Embedded Search Embed -->
<script async src="https://d14dcur0qzt04d.cloudfront.net/v4/YOUR_DATASET_KEY/embedded.js"></script>
4. Complete Field & Setting Reference
| Setting Name | Default Value | Description |
|---|---|---|
embeeded_search_target_class |
"sbpro-embedded-container" |
CSS class name of the container where search renders. |
incoming_keyword_field_name |
"s" |
URL parameter name for incoming search queries (e.g. ?s=, ?q=). |
show_embedded_search_field |
1 (Visible) |
Toggle to show or hide the search input field on the page. |
embedded_form_placeholder |
"Search knowledge base..." |
Placeholder text inside the embedded search input box. |
embedded_form_submit_label |
"Search" |
Label on the search form submit button. |
embedded_results_header_label |
"Search Results for: " |
Header title shown above search results. |
max_records_per_page |
10 |
Number of result cards rendered per page batch. |
max_records |
50 |
Maximum total results returned for any single search. |
results_more_info |
"View Resource" |
Label on the button linking to the product or article URL. |
price_label |
"Price: " |
Prefix displayed next to product prices on result cards. |
show_more_results |
"Load More Results" |
Label on the pagination button to load the next batch of results. |
min_characters_error |
"Please enter at least 3 characters." |
Error message when query is too short. |
no_results |
"No results found matching your search query." |
Alert message when no matching records exist. |
show_search_images |
0 (Disabled) |
Toggle to display thumbnail images on result cards. |
custom_placeholder_image |
Default Placeholder | Custom fallback image URL when a product has no photo. |
show_live_search_on_embedded |
1 (Enabled) |
Toggle to enable autocomplete dropdown on embedded input. |
embedded_search_memory |
1 (Enabled) |
🧠 Saves last search query, results, and scroll position to localStorage. Restores instantly on Back-button navigation. Expires after 30 minutes. Per-dataset namespaced so multiple instances never conflict. |

