Website analytics

Define events without touching the site

analytics_define_events · Changes data · Markdown

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.

With these arguments
{
  "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
    }
  ]
}
What comes back
{
  "site": {
    "site_id": "613e0cdc-d095-4300-8dc0-5f303fc55d76",
    "domain": "halversoncycle.example",
    "name": "Halverson Cycle & Repair",
    "time_zone": "America/Los_Angeles",
    "snippet": "<script defer src=\"https://cncto.co/a.js\" data-site=\"613e0cdc-d095-4300-8dc0-5f303fc55d76\"></script>",
    "events_this_month": 13,
    "clicks_this_month": 0,
    "allowance_per_month": 100000,
    "extra_blocks": 0,
    "monthly_usd": "$3.00",
    "goals": [],
    "events": [
      {
        "name": "Fitting click",
        "kind": "click",
        "text": "Book a fitting"
      },
      {
        "name": "Read the size guide",
        "kind": "scroll",
        "page": "/guides/bike-sizes",
        "percent": 75
      }
    ],
    "spike_alert_visitors": null,
    "weekly_summary": false,
    "track_errors": false,
    "keep_sources": true,
    "created_at": "2026-10-14T08:00:00+00:00"
  }
}

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.

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

NameTypeWhat it is
siteRequiredstringThe site's domain (e.g. halversoncycle.example) or its site_id. 4 to 253 characters.
eventsRequiredarray of objectsUp to 50 items.
events[].nameRequiredstringUp to 60 characters.
events[].kindRequiredstringclick: 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[].textstringclick: the element's words, like "Book a demo". Up to 60 characters.
events[].containsbooleanclick: the words appear anywhere in the element's label.
events[].elementstringclick: the element's path as analytics_heatmap shows it. Up to 300 characters.
events[].pagestringThe page, like /pricing (* for any part); for click and event, only on these pages. Up to 500 characters.
events[].percentintegerscroll: how far down. 10 to 100.
events[].secondsintegertime: seconds on the page. 5 to 3,600.
events[].eventstringevent: the event the site sends, like "Outbound link". Up to 60 characters.
events[].propsobjectevent: 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:

Terminal
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.

CodeWhenWhat to do
not_found404No site the business counts has that domain or site_id.Call analytics_list_sites and use a domain from it.
invalid_input400An 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.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md