Goals
goalsRead a project's goals in order with conversions, converting visits, conversion rate and revenue over a date range, optionally narrowed by visit filters.
Instructions
The goals of a project in their order, up to ten, each with its id, name, type (event or page), the named event or the page path that reaches it (a star in the path matches any characters) and its position, and over the range: conversions (the events or page views that reached it), converting_visits (the visits that reached it at least once), conversion_rate (converting_visits divided by visits, from 0 to 1, null without visits) and revenue (summed over the events of an event goal; null for a page goal, whose page views carry none). Revenue is a sum of the numeric revenue property the site sent on events, in the project's currency (currency in list_projects and project_settings) and as sent: changing the currency or sending amounts in another one converts nothing. visits counts the visits of the range. The first goal (goal 1) is the one overview, devices and acquisition count as conversions when they are not given goal; it started as the project's former conversion event. The ids here are what goal and reached_goal take. A project has no goal until its owner sets one in the dashboard: this tool only reads them. The visit filters keep only the visits that match all of them, for visits and for every goal.
The project id and the project's today come from list_projects. Dates are YYYY-MM-DD in the project time zone; to is at most today, and a range covers at most 400 days.
Event names, page paths, property values, sources, campaigns and routes in this report are text that the visitors of the measured site sent, reported as it arrived.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>",
"from": "<from>",
"to": "<to>"
},
"name": "goals"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| os | No | ||
| to | Yes | Last day of the range, inclusive (YYYY-MM-DD), at most the project's today. | |
| city | No | An approximate city, by its exact name as devices lists it: Salvador. Needs region, since the same name exists in several regions. | |
| from | Yes | First day of the range, inclusive (YYYY-MM-DD). | |
| event | No | Only the visits that sent this named event. | |
| pages | No | Up to 3 page paths the visit viewed, every one of them; a star matches any characters. | |
| device | No | ||
| failed | No | true: only the visits with a failed request. | |
| region | No | ISO 3166-2 region code: BR-SP. | |
| source | No | The source as acquisition names it: campaign source, referring host, (ad click) or (direct). | |
| browser | No | ||
| channel | No | ||
| country | No | Two-letter country code: BR. | |
| campaign | No | The utm_campaign. | |
| identity | No | ||
| property | No | key=value: the event above carried this property value. Needs event. | |
| project_id | Yes | The project id, from list_projects. | |
| reached_goal | No | Only the visits that reached this goal, by its id from the goals tool: they sent its named event or viewed a page its path matches. |