Set conversion goal
set_goalDefine the page's conversion goal so analytics can report a real conversion RATE (conversions ÷ sessions), not just behavioral proxies. The goal is either a CTA click (matched by button/link text, url, and/or section) or a form submission (by name, or any form). Changing the goal re-scores all past data instantly — nothing is migrated. Use action "clear" to remove the goal.
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": {
"pageId": "<pageId>"
},
"name": "set_goal"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | click goal: match the element by where its link leads — an outside URL (or part of it), or "#anchor" for a link to a section of this page, e.g. "#pricing". Buttons lead nowhere: match them by text. | |
| text | No | click goal: match the element by its button/link text as the page's HTML has it (case-insensitive substring), e.g. "Get started". Visitors reading a translation still count. | |
| type | No | click = a tracked click on the converting element; form = a form submission. Required for "set". | |
| label | No | Optional human label for the conversion shown in analytics. Auto-derived when omitted. | |
| action | No | Set (default) or clear the goal. | |
| pageId | Yes | The pageId returned when the page was published. | |
| section | No | click goal: restrict the match to a section id (e.g. "hero"). | |
| formName | No | form goal: restrict to one form by its name (data-form). Omit to count submissions of ANY form. |