List goals

List the goals set up in the site settings.

GET https://cotlet.dev/api/v1/plausible/goals

read

Returns each goal with its display name, trigger (pageview or custom_event) and the page path or event name it matches. It lists the goals as configured, whether or not anyone has converted yet. Use it before add_goal to avoid a duplicate.

Parameters

Parameters: list_goals
NameTypeDescription
site string required string Domain of the site as the Sites page lists it, e.g. acme-shop.example.

Request

cURL
curl "https://cotlet.dev/api/v1/plausible/goals?site=site" \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("plausible", "list_goals", {"site":"site"})
Node.js
const result = await cotlet.call('plausible', 'list_goals', {"site":"site"});
CLI
cotlet call plausible list_goals --data '{"site":"site"}'

Example response

JSON

{
  "site": "acme-shop.example",
  "goals": [
    {
      "name": "Checkout complete",
      "trigger": "pageview",
      "target": "/checkout/thank-you"
    },
    {
      "name": "Newsletter signup",
      "trigger": "custom_event",
      "target": "Newsletter Signup"
    }
  ]
}

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.