What This Feature Does
When customers use your website's search bar, you can automatically open Rep AI chat with their search query already entered. This transforms passive product searches into active conversations, helping shoppers get personalized recommendations and answers immediately.
Why Use This Feature
Increased Engagement: Search is a high-intent signal — customers searching for products are ready to buy. Opening Rep chat at this moment captures their attention when they need help most.
Better Shopping Experience: Instead of browsing search results alone, customers get an AI assistant who understands what they're looking for and can guide them to the perfect product.
Higher Conversions: Shoppers who search and then chat with Rep AI are more likely to complete purchases because they get immediate, personalized assistance.
How to Implement This Feature
This feature requires a developer to add a simple JavaScript function to your website. If you're not comfortable with code, share this article with your web developer or Shopify expert.
Implementation Steps
Identify where your search bar code lives
Find the JavaScript function that handles your website search submissions (usually triggered when customers press Enter or click Search).Add the Rep AI search function
Inside your search handler, add this single line of code:window.rep.search("customer's search query here");Replace "customer's search query here" with the actual variable containing the search text.
Example implementation
If your current search code looks like this:function handleSearch(searchQuery) { // Your existing search logic window.location.href = `/search?q=${searchQuery}`; }Add Rep AI like this:
function handleSearch(searchQuery) { // Open Rep chat with the search query window.rep.search(searchQuery); // Your existing search logic can stay or be removed // window.location.href = `/search?q=${searchQuery}`; }Test the integration
Visit your website
Type a product name in your search bar
Press Enter or click Search
Rep chat should open with your search query already sent
Rep AI should respond with relevant product recommendations
Important Technical Notes
The function handles privacy automatically: If a customer hasn't accepted cookies yet, Rep AI will wait for consent before sending the message. The search query won't be lost.
Repeated searches are managed safely: If a customer edits their search multiple times quickly, Rep AI automatically sends only the most recent query to avoid spam.
Character limits: Search queries are automatically trimmed to 500 characters maximum.
The function is always available: window.rep.search() is available as soon as Rep AI loads on your page.
Use Cases
Fashion & Apparel: A customer searches for "waterproof hiking boots" — Rep chat opens and asks about their preferred style, price range, and specific hiking conditions.
Beauty & Cosmetics: A customer searches for "anti-aging serum" — Rep asks about their skin type, concerns, and ingredient preferences before recommending products.
Home & Garden: A customer searches for "outdoor furniture" — Rep inquires about their space size, weather conditions, and style preferences.
Electronics: A customer searches for "wireless headphones" — Rep asks about their use case (gym, commute, gaming) and budget to narrow down options.
Troubleshooting
Chat doesn't open when I search
Make sure Rep AI is installed and active on your website
Check that your developer added the code in the correct location
Verify the search query variable name matches what you're passing to window.rep.search()
Search query appears empty in chat
The search text variable might be undefined — your developer should verify the variable name
Make sure the function is called with actual text: window.rep.search(searchQuery) not window.rep.search()
Console shows errors
Share the error message with Rep AI support
The function is designed to never crash your site, but we can help optimize the implementation
Need Help?
If you need assistance implementing this feature, contact Rep AI support. We can provide customized code examples for your specific platform or connect you with a technical specialist.