# 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**. ```jsx <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](/docs/developer-guides/widgets/code-editor), add `trackingId` to any element you want to track. ![The Code tab of the Order status Widget scrolled to the Contact support button, whose last prop is trackingId="contact_support_click".](annotated/01-tracking-code.webp "trackingId on each button in the code.") With the [AI Widget Builder](/docs/developer-guides/widgets/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. ![The AI Builder reply for the Order status Widget, ending with Tracking: Clicks on both buttons are tracked, beside the generated order status card.](annotated/02-ai-builder.webp "The AI Builder confirms the tracking it added.") ### 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 `trackingId` count as one element. Use this for items drawn from a list, for example `trackingId="Product card"` on every card. * Renaming a `trackingId` starts 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](/docs/developer-guides/widgets/states) 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**. ![The Widgets page under Analytics with the date range, the Widget appearances chart and the Widgets and tracked elements table, which shows No Widgets appeared in this period.](annotated/03-analytics.webp "Analytics › Widgets, before any Widget has appeared.") > [!NOTE] > > A Widget with no tracked elements shows **No tracked elements yet** under its row. Widgets in the builder preview aren't counted. ## Next steps > [card] Code Editor | /docs/developer-guides/widgets/code-editor | Add trackingIds in the code. > [card] Interactive | /docs/developer-guides/widgets/components/interactive | Buttons worth tracking.