Track MCP widget loads and link clicks
When a tool returns a widget, or a link for the person to open, the tool call alone doesn’t say whether anyone saw it. MCP Tower’s middleware adds tracking to both on the way to the agent, so Measure can show whether widgets appear in AI apps such as ChatGPT and Claude, what people click in them, and which links they open. Your server needs no change.
Three tracking switches control this, each on for a new server:
| Switch | What it does |
|---|---|
| Track widget interactions | Adds a small script to each widget that reports loads, clicks, link openings and errors. |
| Widget load pixels | Adds two invisible images to each widget, to measure how often widgets load in each AI app. |
| Track links | Sends every link in a tool’s answer through your hostname, so MCP Tower can count who opens it. |
When a report needs a switch that is off, it says so, and Admins can turn the switch on from there. Pause tracking on the server’s header stops all three, with the rest of the recording.
Widget tracking
Section titled “Widget tracking”A widget is a resource of HTML that a tool returns for the AI app to display, such as a ChatGPT app
or an MCP App in Claude. When an agent reads a widget resource through MCP Tower, the middleware
adds the tracking script at the start of its <head> and an invisible image at the end of its
<body>. It also gives each tool call an id that the widget learns when it opens, which ties
everything the widget reports back to the call, its agent and its country.
What the script reports
Section titled “What the script reports”| Event | When |
|---|---|
| widget_load | The widget opened in the AI app. |
| widget_click | Someone clicked a link, a button, or an element marked data-track. |
| link_click | The widget opened a link, through the AI app or a tracked link. |
| console_error | The widget logged a console.error, threw an uncaught error, or left a promise rejection unhandled. |
For each click, the script records the element, its type (link, button or element), its visible
text (100 characters at most), its class attribute and, for a link, its address. An element is
named by its data-track attribute, else its id, else its tag and the start of its text. To
name an element yourself, or to track a click on something that isn’t a link or a button, add
data-track="checkout" to it; data-track-type sets its type.
The script reports through the AI app’s own tool bridge, as calls to a tool named _track_event
that the middleware adds to your tool list and answers itself. Your server never receives them,
and they don’t appear as tool calls on Measure. What your server does receive is a ping, at most
once a minute per caller: if it answers 401 or 403, the middleware passes that answer on and
records nothing, so only callers your server accepts can report events. Each report also carries a
signature the middleware put in the tool’s answer, so only a widget from a real tool call can
report, and a report sent twice is recorded once.
The script stores nothing in the browser. The only identifier it creates is a random number for each time the widget loads, kept in memory until the widget closes. It sends at most 60 events per load, of which at most 20 errors. If its setup fails, it turns itself off rather than break the widget.
To choose which events one widget reports, open the server in Inspect, find the widget under Resources, and use its Tracking menu: Load, Clicks and Errors, then Save in the bar at the bottom. Link openings are always reported.
What the pixels count
Section titled “What the pixels count”- The template pixel, at the end of the HTML, loads every time the AI app renders the widget, including when it shows the same widget again. It can’t tell agents apart.
- The load pixel loads once the widget has learned its call’s id, so it is tied to the call. It is recorded once per call, however often it is fetched.
Both load from the person’s browser, not from the agent’s cloud, so they are also how MCP Tower learns where a Claude user is and which browser they use (see Users and sessions).
The widget funnel
Section titled “The widget funnel”Widget funnel follows the tool calls that returned a widget. Each step’s rate is against the first, and a gap between two steps points at a cause:
| Step | A gap from the step before means |
|---|---|
| Tool calls with a widget | (the first step) |
| Template renders, including re-mounts | The AI app never rendered the widget, or blocked the image domain. |
| Loaded with render_id | The widget loaded but never received its call’s id: the AI app dropped it, or the handshake failed. |
| Reported by the tracker | The script’s reports were lost or blocked in the AI app’s tool bridge, for example by approval prompts. |
Under the bars, Click-through is the share of loaded widgets that had at least one click.
The Widget renders card on the key figures is the share of calls with a widget whose widget reported a load, by pixel or script.
Other widget reports
Section titled “Other widget reports”- Widget loads by resource: template renders, loads with the call’s id and tracker reports per widget resource. A tool filter on a tool without a widget says so.
- Widget events: every event by name, and the elements clicked most with their text, class, type, clicks and number of widgets. Text and class are blank for clicks recorded before the script sent them.
- Console errors, under Reliability: errors grouped by their first 200 characters, with where they came from and the widget.
Link click tracking
Section titled “Link click tracking”With Track links on, the middleware rewrites every https:// link in a tool’s answer, in its
text and its structured content, to an address on your public hostname that starts with
/_mcptower/goto/. Opening it records the visit and redirects to the original address at once. The
original address travels signed inside the link itself: nothing is stored to resolve it, and the
redirect can’t be used to send anyone elsewhere.
- Links to your own public hostname,
http://links and addresses over 2 KB are left as they are. - Up to 200 distinct links per answer are rewritten.
- A visit records the link and the kind of visitor: an AI agent, a person’s browser, or a crawler. It never records the visitor’s IP address.
- Within 30 days, a link’s visits are recorded once per person’s browser, once for AI agents and once for crawlers. Opening the same link again, or fetching it in a loop, adds nothing.
Rewriting can break a widget that loads images or data from the links in its tool’s answer, and those loads then count as clicks. If one of your widgets does this, test it with Track links on.
The link funnel
Section titled “The link funnel”| Figure | Meaning |
|---|---|
| Links issued | Distinct links in tool answers. |
| Visited by the agent | Distinct links the agent fetched through the redirect. |
| Clicked by a person | Distinct links a person opened from the chat. |
| Crawler hits | Links a crawler fetched, once per link in 30 days. |
| Agent visit rate | Links the agent visited, of links issued. |
| Chat click rate | Links a person clicked, of links issued. |
| Broken links | Visits to a link MCP Tower issued that arrived damaged, often one the model shortened. A link it never issued isn’t counted. |
The Link clicks card counts links people opened, once per link, with the chat click rate.
Top links
Section titled “Top links”Top links lists the links people clicked most, grouped by host and path with the query string dropped. Each row shows the tools that returned it, links issued, clicks by people, agent visits, click rate and when it was last clicked. Expand a row for its exact addresses, up to 20, each with its own counts and a copy button. Show sets how many rows: 10, 25, 50 or 100.
See the Measure overview for the rest of the page.