Matomo Goals API

Goals API lets you Manage existing goals, via "updateGoal" and "deleteGoal", create new Goals via "addGoal", or list existing Goals for one or several websites via "getGoals" If you are tracking Ecommerce orders and products on your site, the functions "getItemsSku", "getItemsName" and "getItemsCategory" will return the list of products purchased on your site, either grouped by Product SKU, Product Name or Product Category. For each name, SKU or category, the following metrics are returned: Total revenue, Total quantity, average price, average quantity, number of orders (or abandoned carts) containing this product, number of visits on the Product page, Conversion rate. By default, these functions return the 'Products purchased'. These functions also accept an optional parameter &abandonedCarts=1. If the parameter is set, it will instead return the metrics for products that were left in an abandoned cart therefore not purchased. The API also lets you request overall Goal metrics via the method "get": Conversions, Visits with at least one conversion, Conversion rate and Revenue. If you wish to request specific metrics about Ecommerce goals, you can set the parameter &idGoal=ecommerceAbandonedCart to get metrics about abandoned carts (including Lost revenue, and number of items left in the cart) or &idGoal=ecommerceOrder to get metrics about Ecommerce orders (number of orders, visits with an order, subtotal, tax, shipping, discount, revenue, items ordered) See also the documentation about Tracking Goals in Matomo.

Operations 11

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /index.php?module=API&method=Goals.getGoal Get a single goal · Goals get goal #
Ask an LLM
“What pattern and revenue are set on one particular goal?”
“Can I look up a goal's configuration by its ID?”
Tell an agent
Get goal {idGoal} on site {idSite}.
Show the match rule configured for goal {idGoal}.
GET /index.php?module=API&method=Goals.getGoals List goals for websites · Goals get goals #
Ask an LLM
“Which conversion goals are set up on my website?”
“Can I list goals across several sites, sorted by name?”
Tell an agent
List all goals for site {idSite}.
Show the goals defined on sites {idSite} ordered by name.
GET /index.php?module=API&method=Goals.addGoal Create a conversion goal · Goals add goal #
Ask an LLM
“How do I track a conversion when someone visits a thank-you page?”
“Can a goal assign revenue or allow several conversions per visit?”
Tell an agent
Create goal {name} on site {idSite} matching {matchAttribute} with {patternType} pattern {pattern}.
Add a goal called {name} worth {revenue} that triggers on {matchAttribute} {pattern} using {patternType} matching.
GET /index.php?module=API&method=Goals.updateGoal Update an existing goal · Goals update goal #
Ask an LLM
“Will editing a goal reprocess conversions that were already recorded?”
“Can I change the URL pattern on a goal I already have?”
Tell an agent
Update goal {idGoal} on site {idSite} to name {name}, matching {matchAttribute} {patternType} {pattern}.
Change the revenue of existing goal {idGoal} to {revenue}.
GET /index.php?module=API&method=Goals.deleteGoal Delete a goal · Goals delete goal #
Ask an LLM
“How do I remove a goal I no longer track?”
“Is deleting a goal a soft delete?”
Tell an agent destructive · confirm first
Delete goal {idGoal} from site {idSite}.
Remove goal {idGoal}.
GET /index.php?module=API&method=Goals.getItemsSku Report ecommerce sales by product SKU · Goals get items sku #
Ask an LLM
“Which product SKUs sold the most last month?”
“Can I see abandoned cart items grouped by SKU?”
Tell an agent
Show ecommerce product metrics by SKU for site {idSite} for {period} {date}.
List SKUs left in abandoned carts on site {idSite} on {date}.
GET /index.php?module=API&method=Goals.getItemsName Report ecommerce sales by product name · Goals get items name #
Ask an LLM
“What are my best-selling products by name?”
“Can I compare product revenue grouped by product name for a period?”
Tell an agent
Show ecommerce product metrics by product name for site {idSite} for {period} {date}.
Rank products by name for store site {idSite} on {date}.
GET /index.php?module=API&method=Goals.getItemsCategory Report ecommerce sales by product category · Goals get items category #
Ask an LLM
“Which product categories bring in the most revenue?”
“Can I see abandoned cart totals per product category?”
Tell an agent
Show ecommerce product metrics by category for site {idSite} for {period} {date}.
Break down sales by product category for site {idSite} on {date}.
GET /index.php?module=API&method=Goals.get Get goal and ecommerce conversion metrics · Goals get #
Ask an LLM
“What's my overall conversion rate and goal revenue for this month?”
“Can I compare conversions from new versus returning visitors?”
Tell an agent
Get goal conversion metrics for site {idSite} for {period} {date}.
Show conversions and revenue for goal {idGoal} on site {idSite} on {date}.
GET /index.php?module=API&method=Goals.getDaysToConversion Report days from first visit to conversion · Goals get days to conversion #
Ask an LLM
“How many days does it usually take a visitor to convert?”
“Can I see time-to-conversion in days for a particular goal?”
Tell an agent
Show conversions grouped by days to convert for site {idSite} for {period} {date}.
Break down days-to-conversion for goal {idGoal} on {date}.
GET /index.php?module=API&method=Goals.getVisitsUntilConversion Report visits needed before conversion · Goals get visits until conversion #
Ask an LLM
“How many visits do people make before they convert?”
“Can I see visits-to-conversion for one goal only?”
Tell an agent
Show conversions grouped by number of visits for site {idSite} for {period} {date}.
Break down visits-until-conversion for goal {idGoal} on {date}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/matomo:matomo-goals-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

matomo-goals-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Matomo Reporting API for plugin Goals API
  version: 1.0.0
  description: Goals API lets you Manage existing goals, via "updateGoal" and "deleteGoal", create new Goals via "addGoal", or list existing Goals for one or several websites via "getGoals" If you are tracking Ecommerce orders and products on your site, the functions "getItemsSku", "getItemsName" and "getItemsCategory" will return the list of products purchased on your site, either grouped by Product SKU, Product Name or Product Category.
servers:
- url: https://demo-proxy.innocraft.cloud/
  description: Current Matomo instance
security:
- MatomoToken: []
tags:


# --- truncated at 32 KB (34 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/matomo/refs/heads/main/openapi/matomo-goals-api-openapi.yml