Webless emits DOM custom events with the
webless: prefix and a structured
event.detail payload.Add listeners after Webless initializes
Supported events
Session and initialization
Session and initialization
| Event | Fired when | Core fields |
|---|---|---|
webless:session_start | A new user session starts | sessionId, timeStamp, eventType |
Search bar visibility
Search bar visibility
| Event | Fired when | Core fields |
|---|---|---|
webless:searchbar_visible | The search bar enters the viewport | sessionId, location, timeStamp, eventType |
webless:searchbar_hidden | The search bar leaves the viewport | sessionId, location, timeStamp, eventType |
webless:searchbar_close | A user closes the floating search bar | sessionId, location, timeStamp, eventType |
User interaction
User interaction
| Event | Fired when | Core fields |
|---|---|---|
webless:searchbar_click | A user submits a search query | query, sessionId, timeStamp, eventType |
webless:suggested_question_click | A user clicks a suggested question | query, sessionId, timeStamp, eventType |
webless:tile_click | A user clicks a result tile | query, sessionId, timeStamp, eventType |
webless:click_cta | A user clicks the CTA button | query, sessionId, timeStamp, eventType |
Floating button
Floating button
Payload shape
Example payloads
Performance and troubleshooting
Events are not firing
Events are not firing
- Make sure Webless finished initializing before you add listeners.
- Make sure your listener script appears after the Webless script.
- Make sure no browser console errors stop later scripts from running.
Visibility events fire too often
Visibility events fire too often
Debounce frequent events before forwarding them to your analytics service.
