Add goal

Add a pageview or custom event goal in the site settings.

MCP tool plausible_write → add_goal

write

Opens Goals in the site settings, clicks + Add goal and saves it. A custom event name must match what your site sends, including capitalisation. Plausible counts a goal only from the moment it exists and does not backfill, and shows it in the dashboard after its first conversion. It reaches no one, and the goal can be edited in the settings at any time.

Parameters

Parameters: add_goal
NameTypeDescription
site string required string Domain of the site as the Sites page lists it, e.g. acme-shop.example.
trigger string required string pageview or custom_event.
target string required string Page path for a pageview goal (an asterisk matches a pattern, e.g. /blog*), exact event name for a custom event goal.
display_name string string Name shown in the Goals report. Default: Plausible fills it from the path or event name.

tools/call

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "plausible_write",
    "arguments": {
      "operation": "add_goal",
      "arguments": {
        "site": "acme-shop.example",
        "trigger": "pageview",
        "target": "/checkout/thank-you",
        "display_name": "Checkout complete"
      }
    }
  }
}

Example response

JSON

{
  "content": [
    {
      "type": "text",
      "text": "{ ... same JSON as structuredContent ... }"
    }
  ],
  "structuredContent": {
    "site": "acme-shop.example",
    "name": "Checkout complete",
    "trigger": "pageview",
    "target": "/checkout/thank-you",
    "status": "added"
  },
  "isError": false
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.