Create a page or link goal
create_goal_definitionCreates a goal from a page path (* one segment, ** any), a link to another site, or a button text, form or file from automatic events; it counts past visits at once. Ask before calling. The name can't change later (set a display name with update_goal_customization). Requires the write scope.
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": {
"name": "<name>",
"kind": "<kind>"
},
"name": "create_goal_definition"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | download only: a file name (pricing.pdf, exact) or an extension (.pdf: any file with it). | |
| form | No | form only: the form's id or name attribute, exact, e.g. signup. | |
| host | No | outbound only: the other site, e.g. stripe.com (subdomains included). | |
| kind | Yes | page: someone views a page. outbound: someone clicks a link to another site. click, form, download: a button text, form or file from automatic events (switched on in Settings → Tracking & install → Automatic events). | |
| name | Yes | Goal name: a letter, then letters, numbers, _ : . or - (e.g. visited_pricing). | |
| path | No | Page path pattern, e.g. /pricing, /blog/* (one segment) or /docs/** (any depth); letter case is ignored. For outbound, optional: the path on the other site. | |
| text | No | click only: the button text, exact but any letter case, e.g. Start free trial. | |
| website_id | No | Website ID from list_websites (the data-site-id value in the tracking script). |