Define events without touching the site
Defines events from what the script already sees (clicks, pages, scrolling, time on a page, props), with nobody editing the site.
Free
This tool costs nothing to call.
An example
Count every click on "Book a fitting" as a lead, and everyone who reads the bike size guide to the end.
Your agent callsanalytics_define_eventsFree
The example business is Halverson Cycle & Repair, a bike shop with a repair workshop in Portland, Oregon. The reply is the one the tool really gives.
{
"site": "halversoncycle.example",
"events": [
{
"name": "Fitting click",
"kind": "click",
"text": "Book a fitting"
},
{
"name": "Read the size guide",
"kind": "scroll",
"page": "/guides/bike-sizes",
"percent": 75
}
]
}Use it when
The business wants to count something the site doesn't send itself, like clicks on a button or reading a page to the end.
- For conversions with a rate and revenue, use
analytics_set_goals.
What it does
The events to count from what the script already sees, replacing the site's defined events: a click (on an element by its words, or by its path from analytics_heatmap), a page reached, a page scrolled past a share, time spent on a page, or an event the site sends narrowed by its props (a link out to calendly.com is {"event": "Outbound link", "props": {"url": "https://calendly.com/*"}}). Nobody edits the site. Page, scroll, time and event rules count backwards over the stored months too; clicks count from now on. A defined event works wherever an event does: analytics_stats, goals, funnels, filters and analytics_breakdown. An empty list removes them.
What comes back
The site, with the events it now defines. Every reply also carries cost_usd and balance_usd.
Inputs
| Name | Type | What it is |
|---|---|---|
siteRequired | string | The site's domain (e.g. halversoncycle.example) or its site_id. 4 to 253 characters. |
eventsRequired | array of objects | Up to 50 items. |
events[].nameRequired | string | Up to 60 characters. |
events[].kindRequired | string | click: someone clicked an element; page: a page was reached; scroll: a page was scrolled past percent; time: someone spent seconds on a page; event: an event the site already sends, narrowed by its props. One of: click,page,scroll,time,event. |
events[].text | string | click: the element's words, like "Book a demo". Up to 60 characters. |
events[].contains | boolean | click: the words appear anywhere in the element's label. |
events[].element | string | click: the element's path as analytics_heatmap shows it. Up to 300 characters. |
events[].page | string | The page, like /pricing (* for any part); for click and event, only on these pages. Up to 500 characters. |
events[].percent | integer | scroll: how far down. 10 to 100. |
events[].seconds | integer | time: seconds on the page. 5 to 3,600. |
events[].event | string | event: the event the site sends, like "Outbound link". Up to 60 characters. |
events[].props | object | event: its props, * for any part, like {"url": "https://calendly.com/*"}. |
The call
Over MCP, call analytics_define_events on https://api.conecto.chat/mcp/analytics. Over REST:
curl -X POST https://api.conecto.chat/v1/tools/analytics_define_events \
-H "Authorization: Bearer $CONECTO_KEY" \
-H "Content-Type: application/json" \
-d '{"site":"halversoncycle.example","events":[{"name":"Fitting click","kind":"click","text":"Book a fitting"},{"name":"Read the size guide","kind":"scroll","page":"/guides/bike-sizes","percent":75}]}'When it refuses
A refused call costs nothing and says what to do next.
| Code | When | What to do |
|---|---|---|
not_found404 | No site the business counts has that domain or site_id. | Call analytics_list_sites and use a domain from it. |
invalid_input400 | An event has no name or kind, two share a name, the name is one Conecto counts already, or the rule misses what its kind needs. | Fix the event the message names: a click needs text or element; page, scroll and time a page; scroll a percent and time seconds. |
More Website analytics tools
All 18 tools- Count a website's visits
analytics_add_siteStarts counting visits to a website, without cookies, and returns the snippet for its pages.$3.00 a call - Get install steps
analytics_installStep-by-step instructions to put the counting script on a site: any html, Shopify, WordPress, Webflow or Google Tag Manager.Free* - Read a site's stats
analytics_statsA site's visitors, pages, sources, countries, devices, events, goals and speed for a period, against the period before.Free* - Break an event or goal down
analytics_breakdownOne event or goal by a prop or by where its visits came from, with conversions, conversion rate and revenue.Free* - Who is on a site now
analytics_realtimeVisitors in the last 5 minutes, and the pages people looked at in the last 30.Free* - Set a site's goals
analytics_set_goalsSets the conversions a site counts: pages reached or events, replacing its goals; with notify, the agent hears of each one as it happens.Free - Track events from outside the site
analytics_trackRecords events that happen away from the site, like orders, deals won or renewals, tied to the visit that led to them when it can be found.Free - See where people drop off
analytics_funnelHow many visitors did each step of a path in order, and how many dropped out at each one.Free*
Give this to your agent.
Set up Conecto from https://conecto.chat/SKILL.md