Page Events

Open in CMS

The Page Events screen defines events your agent can send to the web page its chat is embedded in, so the page can react to the conversation: open a product, fill in a form, go to checkout. Found in the agent sidebar under Tools β†’ Page Events. Changes are kept on the page until you click Save all changes. For a walkthrough, see Make Your Page React to the Agent.

Page Events

Only on a page that embeds the chatA note that the agent is offered page events only while its chat runs inside the qlar widget on a web page, not on WhatsApp or the standalone chat. It links to Channels β€Ί Embed and opens the builder.
Add page eventOpens the New Page Event panel.
Page event rowShows the action name, the event name and the description. Click it to open Edit Page Event.
Enabled switchTurns the page event on or off without deleting it. While it is off, the row is dimmed with an Off chip, the agent is not offered it, and the embed builder does not list it. Takes effect when you save.
Delete buttonRemoves the page event from the list, after you confirm.
Empty state"No page events yet" is shown when the agent has none.
Listen on your pageA code example that listens for qlarPageEvent on the widget element.
Save all changesSaves every page event after you confirm.

New Page Event / Edit Page Event

Basic Information

Action NameRequired. The name the AI knows the action by, for example show_product.
Event NameRequired. What the page receives as event.detail.name, for example open_product. Starts with a letter and uses only letters, digits, _, -, . or :, up to 64 characters. Two page events cannot share an event name.
DescriptionWhat the event does on the page and when to send it. The AI decides from this text.
RulesOptional. Extra conditions for sending the event.

Parameters

The values the AI fills in from the conversation. The page receives them as event.detail.parameters. qlar refuses an event whose values do not match the definitions, and the AI tries again.

Property NameRequired. The key in event.detail.parameters. Two properties cannot share a name.
Property TypeRequired. String, Number or Boolean.
Required ParameterOn: the event is not sent without this value.
Property EnumOptional. The only values allowed. Press Enter after each one.
Property DescriptionTells the AI what to put in the property.
Add New PropertyAdds a property. The trash icon removes one, after you confirm.

A page event has no request, so unlike a Custom API there is no location, HTTP method, URL, authentication or loading text.

Metadata

Filled in by qlar, never by the AI, and sent as event.detail.metadata. Every script on the embedding page can read it, so only values that are safe there are offered.

Agent ID (agentId)The agent's published ID. On by default.
Conversation ID (threadId)The conversation's ID. It cannot be used to read the conversation. On by default.
Message ID (messageId)The ID of the visitor's message the event answers. On by default.
Channel (channel)text or voice. On by default.
Timestamp (timestamp)When the event was sent, in ISO 8601 UTC. On by default.
User ID (userId)The signed-in visitor's qlar user ID; empty for an anonymous visitor. Off by default.
User email (userEmail)The signed-in visitor's email address; empty for an anonymous visitor. Off by default.
Personal data warningShown when User ID or User email is on: the values go to the embedding page and every script on it, are never sent in privacy mode, and are empty for anonymous visitors.

Organization and owner IDs, permissions, file links and messenger accounts are never sent to a page.

Add Page Event / Update Page Event

Checks the form and puts the page event in the list. It is saved with Save all changes.

What the Page Receives

The widget element dispatches a qlarPageEvent that bubbles. Its detail:

nameThe event name.
parametersThe parameters with the AI's values.
metadataThe metadata you chose, with qlar's values.
idUnique per event.
agentIdThe data-agent-id of the widget that sent it.

Events are sent once, while the conversation happens. Reopening a conversation does not send them again.