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.
AddOpens the New page event panel.
Page event rowShows the action name, the event name and the description. Click it to open Edit page event.
Sent to the pageA switch that turns the page event on or off without deleting it. While it is off, the agent is not offered it, and the embed builder does not list it. Takes effect when you save.
Row menuEdit page event and Remove page event.
Remove page eventAsks you to confirm, then removes the page event from the list. The removal is saved with Save all changes.
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

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.

NameRequired. The key in event.detail.parameters. Two parameters cannot share a name.
TypeRequired. String, Number or Boolean.
RequiredOn: the event is not sent without this value.
Allowed valuesOptional. The only values allowed. Type a value and press Enter after each one.
DescriptionTells the AI what to put in the parameter.
Add parameterAdds a parameter. 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. Metadata is chosen under Send these with the event.

Agent ID (agentId)The agent's published ID. It is already public in your embed snippet. Selected by default.
Conversation ID (threadId)Identifies the conversation, for example to match the event to your own logs. It cannot be used to read the conversation. Selected by default.
Message ID (messageId)The ID of the visitor's message the event answers. Selected by default.
Channel (channel)text or voice: how the visitor is talking to the agent. Selected by default.
Timestamp (timestamp)When the event was sent, in ISO 8601 UTC. Selected by default.
User ID (userId)The signed-in visitor's qlar user ID. Empty for an anonymous visitor. Not selected by default.
User email (userEmail)The signed-in visitor's email address. Empty for an anonymous visitor. Not selected by default.
Personal data warningShown when User ID or User email is selected: 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 / Apply

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.