Website analytics

Track events from outside the site

analytics_track · Changes data · Markdown

Records 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

This tool costs nothing to call.

An example

The Alder Street Hotel ordered 8 guest bikes for $9,400. Count it as a won deal and credit the campaign that brought them.

Your agent callsanalytics_trackFree

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": "Deal won",
      "email": "events@alderstreethotel.example",
      "revenue": 9400,
      "currency": "USD",
      "props": {
        "pipeline": "Fleet"
      }
    }
  ]
}
What comes back
{
  "site": "halversoncycle.example",
  "events": [
    {
      "event": "Deal won",
      "stored": true,
      "tied_to": "contact",
      "source": "Google",
      "channel": "Organic search",
      "campaign": null
    }
  ],
  "stored": 1
}

Use it when

Something worth counting happened outside the website: a Shopify order, a deal won, a call that booked a demo.

What it does

Record what happened away from the site's pages: a Shopify order, a deal won, a call that booked a demo, a renewal. Up to 100 at once, each with props and revenue. An event joins the visit that led to it when you give the visitor's IP address and user agent (a Shopify order carries both; they find the visit and are never kept), or the email or contact of a person whose first visit Conecto kept; otherwise it counts without a source. Then analytics_breakdown shows which channels and campaigns bring the money. Don't track what the site itself already sends, or it counts twice. Free; each event counts toward the site's monthly events.

What comes back

Each event with whether it was stored and what it was tied to (the visit, the contact's first visit, or nothing), with its source, channel and campaign; stored: how many were kept. 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 objects1 to 100 items.
events[].nameRequiredstringUp to 60 characters.
events[].propsobjectUp to 10 plain values, like {"plan": "pro"}.
events[].revenuenumber or stringThe money it brought, like 129.90.
events[].currencystringExactly 3 characters.
events[].atstringWhen it happened, with its offset; now if left out. Up to 40 characters.
events[].visitorobjectThe IP address and user agent the order or form came from, as Shopify and most forms record them: to find the visit that led to it. Used once, never kept.
events[].visitor.ipstringUp to 45 characters.
events[].visitor.user_agentstringUp to 500 characters.
events[].emailstringA person whose first visit Conecto kept: the event is credited to it. Up to 254 characters.
events[].contact_idintegerThe same, by CRM contact.
events[].pagestringWhere it happened, like /checkout. Up to 500 characters.

The call

Over MCP, call analytics_track on https://api.conecto.chat/mcp/analytics. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/analytics_track \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"site":"halversoncycle.example","events":[{"name":"Deal won","email":"events@alderstreethotel.example","revenue":9400,"currency":"USD","props":{"pipeline":"Fleet"}}]}'

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, an IP address that is not one, a time outside the last 30 days or revenue without a currency, or there are more than 100.Fix the event the message names.

Give this to your agent.

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