Widgets
Click Tracking
See how often visitors use the buttons, links and fields in your Widgets, and each one's interaction rate.
Add a trackingId to an element in your Widget's code, and QwryAI counts how often visitors see it and use it. You don't need any code on your website. The counts and the rate appear in Analytics › Widgets.
<Card>
<Col gap={3}>
<Title value="Where's my order?" />
<Button label="Track package" trackingId="Track package" onClickAction={{ functionName: "openTrackingLink" }} />
<Button label="Contact support" trackingId="Contact support" variant="outline" onClickAction={{ functionName: "contactSupport" }} />
</Col>
</Card>The trackingId is also the element's label in analytics, so give each one a short name a person can read.
Add a trackingId
In the code editor, add trackingId to any element you want to track.
With the AI Widget Builder, ask for it in your own words, for example "track clicks on both buttons". The builder adds trackingIds only when you ask.
Rules
- The value is plain text, such as
trackingId="Track package". - The value can't be empty and can be up to 100 characters.
- Elements that share a
trackingIdcount as one element. Use this for items drawn from a list, for exampletrackingId="Product card"on every card. - Renaming a
trackingIdstarts a new row in analytics. The old name keeps its history.
Supported elements
Every element accepts a trackingId. What counts as an interaction depends on the element:
| Element | What counts as an interaction |
|---|---|
Button | A click |
Image, ListViewItem and other elements with an onClickAction | A click |
Form | A submit |
Input, Textarea | Changing its text |
Select, RadioGroup, DatePicker | Choosing a value |
Checkbox | Checking or unchecking it |
Markdown | A click on a link inside it |
On a layout element such as a Col, a click on anything inside it counts as an interaction with it. Focusing or hovering an element is never counted.
What Gets Counted
Each time your agent shows a Widget in a conversation is one appearance. For each tracked element in that appearance, QwryAI counts:
- Impressions: 1 if the element was shown. An element inside a state that never became visible, or an empty list, gets no impression.
- Interactions: 1 if the visitor used the element at least once. Clicking a button five times in the same appearance still counts once.
The Rate is interactions divided by impressions, per day the Widget appeared, so each day's rate stays between 0% and 100%.
Find the results under Analytics › Widgets. Each Widget's row shows its Appearances, and its tracked elements are listed under it with their Impressions, Interactions and Rate.