Set a site's goals
Sets the conversions a site counts: pages reached or events, replacing its goals; with notify, the agent hears of each one as it happens.
Free
This tool costs nothing to call.
An example
Count it as a conversion whenever someone finishes checkout or signs up for the newsletter.
Your agent callsanalytics_set_goalsFree
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",
"goals": [
{
"name": "Order placed",
"page": "/checkout/done"
},
{
"name": "Newsletter",
"event": "Subscribe"
}
]
}Use it when
The business wants to know how many visitors did something that matters: ordered, signed up, booked.
What it does
The conversions to count, replacing the site's goals: a page reached ({"name": "Order placed", "page": "/checkout/done"}) or a custom event, optionally with props ({"name": "Pro signup", "event": "Signup", "props": {"plan": "pro"}}). analytics_stats then shows each goal's visitors, conversions, conversion rate and revenue (from conecto("Purchase", {...}, {revenue: 49.9, currency: "USD"})). An empty list removes them.
What comes back
The site, with the goals it now counts. 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. |
goalsRequired | array of objects | Up to 20 items. |
goals[].name | string | Up to 60 characters. |
goals[].page | string | A page reached, like /thanks or /order/*/done. Up to 500 characters. |
goals[].event | string | A custom event, like Signup, or one analytics_define_events made. Up to 60 characters. |
goals[].props | object | Only events with these props, like {"plan": "pro"}. |
goals[].notify | boolean | Send analytics.goal_completed the moment a visitor reaches it, with where they came from and what they saw. |
The call
Over MCP, call analytics_set_goals on https://api.conecto.chat/mcp/analytics. Over REST:
curl -X POST https://api.conecto.chat/v1/tools/analytics_set_goals \
-H "Authorization: Bearer $CONECTO_KEY" \
-H "Content-Type: application/json" \
-d '{"site":"halversoncycle.example","goals":[{"name":"Order placed","page":"/checkout/done"},{"name":"Newsletter","event":"Subscribe"}]}'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 | A goal has no name, two goals share a name, or a goal is not exactly one page or one event. | Give each goal its own name and either a page like /checkout/done or an event like Subscribe. |
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* - Define events without touching the site
analytics_define_eventsDefines events from what the script already sees (clicks, pages, scrolling, time on a page, props), with nobody editing the site.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