Skip to content

Report your site's events to help.ai

Tell the AI agent what the visitor just did on your site, and count it, with track().

Last updated

Your page knows things the chat doesn't: the plan the visitor is looking at, what's in their cart, the error they just saw. Tell help.ai with track():

js
const chat = await HelpAI.ready();
chat.track('plan_viewed', { plan: 'pro' });
chat.track('cart_updated', { items: 2, total: 48.5 });

What each call does#

  • The AI agent learns it. The widget keeps your last 10 events and sends them, with how long ago each happened, along with the visitor's next message. The agent can say "I see you were looking at the Pro plan." It treats them as information from your site, never as instructions. They last for the page view.
  • It's counted. Each call sends one usage event with its name and data, like the widget's own events. Nothing is sent when the widget's tracking is turned off (tracking: { enabled: false }) or the visitor's browser asks not to be tracked.

What you can send#

Rule
Name1 to 64 characters
DataOptional. Flat: strings, numbers and true or false, with other values left out. Up to 256 characters as JSON; longer data isn't sent, but the name still is.

Never put personal details in either: use ids and plan names, not emails or names.

Other ways to call it#

How you installedCall
Quick install script tagHelpAI('track', 'plan_viewed', { plan: 'pro' }), which also works before the widget has loaded
<web-ai-chat> elementelement.track('plan_viewed', { plan: 'pro' })
React kituseHelpAI().track('plan_viewed', { plan: 'pro' })

Each event also reaches your own listeners as hostEvent:

js
chat.on('hostEvent', ({ name, data }) => console.log(name, data));

You need widget 1.11.0 or later.

To let the agent act on your page, not only know about it, use page tools.

Was this helpful?

Still need help?

Ask the community