invantive documentation
Invantive Support ForumsLog In / Sign Up

Goals: Matomo Matomo Goals Get Goals

insert REST

  • Catalog: Matomo
  • Schema: Goals
  • Primary Keys: idgoal
  • Label: Matomo Goals Get Goals

Can retrieve data and change data using insert.

Summary

Every goal defined on one site - one row per goal, empty where no goal is defined at all (measured live on this container before any goal existed on it). Read + insert; update and delete are open, see the remarks above.

API Source

  • Endpoint: /index.php?module=API&method=Goals.getGoals&idSite={id_site}&format=json

Performance Characteristics

Characteristic Value
Write rows per minute 37,800

The result can be cached on the client.

Parameters

Name Data Type Required Default Documentation
id_site number The Matomo site ID to list goal definitions for.

Table Columns

The columns of the table Goals are shown below. Each column has an SQL data type. A new non-null value must be provided for every required column at all times during insert and update.

Name Data Type Label Required Marks Documentation
allow_multiple int32 itgen_mat_allow_multiple filters on the platform, writable Whether one visit can convert this goal more than once - Matomo's own 0/1 flag, not a Boolean. Matomo's own parameter is 'allowMultipleConversionsPerVisit', not just a different case of this column's own name.
case_sensitive int32 itgen_mat_case_sensitive filters on the platform, writable Whether the match is case-sensitive - Matomo's own 0/1 flag, not a Boolean. Matomo's own parameter is 'caseSensitive'.
deleted int32 itgen_mat_deleted filters on the platform, writable Whether this goal has been deleted - Matomo's own 0/1 flag, not a Boolean; a deleted goal keeps its historical conversions but drops out of future tracking. Read-only: deleteGoal is not wired up, see the remarks above.
description varchar2 itgen_mat_description filters on the platform, writable The goal's own description, blank unless one was entered when it was created.
event_value_as_revenue int32 itgen_mat_event_value_as_revenue filters on the platform, writable Whether an event's own numeric value is counted as this goal's revenue when it converts - Matomo's own 0/1 flag, not a Boolean. Matomo's own parameter is 'useEventValueAsRevenue'.
idgoal int32 itgen_mat_idgoal filters on the platform, writable The ID of the goal - not globally unique, reused across sites (Goals/Model.php's own getNextIdGoal computes max(idgoal)+1 per site). Assigned by Matomo on insert, never written.
idsite int32 itgen_mat_idsite filters on the platform, writable The Matomo site ID this goal belongs to. Matomo's own addGoal() takes it as 'idSite'.
match_attribute varchar2 itgen_mat_match_attribute filters on the platform, writable What a hit is matched against to convert this goal, for instance 'url', 'title' or 'event_category'. Required on insert; Matomo's own parameter is 'matchAttribute'.
name varchar2 itgen_mat_name filters on the platform, writable The goal's name, as entered when it was created. Required on insert.
pattern varchar2 itgen_mat_pattern filters on the platform, writable The pattern match_attribute is matched against. Required on insert.
pattern_type varchar2 itgen_mat_pattern_type filters on the platform, writable How pattern is matched, for instance 'contains', 'exact' or 'regex'. Required on insert; Matomo's own parameter is 'patternType'.
revenue double itgen_mat_revenue filters on the platform, writable The fixed revenue value attributed to one conversion of this goal, as configured on the goal itself - distinct from Goals.get's own revenue column, which is a summed metric rather than a per-goal setting.