Turn any button, link, or element on your website into a conversation starter. AI Agent Triggers let you open the chat widget with pre-filled prompts — perfect for replacing contact forms, adding product inquiries, and creating contextual help experiences.
6 min read
Updated January 2026
AI Agent Triggers allow you to open the ChatSpark widget from any clickable element on your website — with an optional pre-filled message. Instead of customers clicking the chat bubble and figuring out what to ask, you guide them with context-specific prompts.
Common use cases:
Add two attributes to any HTML element to make it trigger your AI Agent:
class="cs-trigger-agent" — Tells ChatSpark this element opens the widgetdata-trigger="Your message here" — Pre-fills the chat with your prompt (optional)Basic example:
<button class="cs-trigger-agent" data-trigger="I'd like to learn more">
Chat With Us
</button>When a visitor clicks this button, the chat widget opens and automatically sends "I'd like to learn more" — starting the conversation with context.
data-trigger attribute, the widget simply opens without a pre-filled message. Useful for generic "Chat Now" buttons.Traditional contact forms are friction-heavy and often go unanswered for days. Replace them with AI Agent Triggers for instant, conversational engagement.
Example implementation:
<!-- Replace your contact form with this -->
<a href="#" class="cs-trigger-agent" data-trigger="I'd like to contact your team">
Contact Us
</a>
<!-- Or a more specific prompt -->
<button class="cs-trigger-agent" data-trigger="I have a question about your services">
Get In Touch
</button>Add "Learn More" buttons throughout your website that open conversations about specific products or services.
Product page example:
<div class="product-card">
<h3>Professional Camera Kit</h3>
<p>Everything you need to start your photography journey.</p>
<button class="cs-trigger-agent" data-trigger="Tell me more about the Professional Camera Kit">
Learn More
</button>
</div>Service page example:
<button class="cs-trigger-agent" data-trigger="What's included in your consulting services?">
Ask About Consulting
</button>Pricing page example:
<a href="#" class="cs-trigger-agent" data-trigger="I have a question about your pricing">
Have Questions?
</a>Place contextual help buttons throughout your app or documentation to provide instant support exactly where users need it.
Feature-specific help:
<button class="cs-trigger-agent" data-trigger="How do I set up Lead Capture?">
Need Help?
</button>FAQ shortcuts:
<ul class="faq-list">
<li>
<a href="#" class="cs-trigger-agent" data-trigger="What are your business hours?">
What are your business hours?
</a>
</li>
<li>
<a href="#" class="cs-trigger-agent" data-trigger="What's your return policy?">
What's your return policy?
</a>
</li>
<li>
<a href="#" class="cs-trigger-agent" data-trigger="How do I track my order?">
How do I track my order?
</a>
</li>
</ul>Error page recovery:
<!-- On a 404 page -->
<p>Can't find what you're looking for?</p>
<button class="cs-trigger-agent" data-trigger="I can't find what I'm looking for on your website">
Ask Our AI Agent
</button>The more context you provide in the trigger, the better the response:
"Help""Help me understand your pricing plans"Button text should tell visitors what happens when they click:
Click HereAsk About PricingGet Product DetailsChat With SalesReview your Chat History to see how visitors interact with different triggers. Adjust prompts based on what leads to the best conversations.