For information about how REST API works, see rest main page.
Conversion goals — the events Personyze counts as success. A goal is what campaign reporting measures against, and what an A/B test can be scored on: every goal_event_<n> criterion in ab_test refers to one of these.
You can see and manage goals in the panel.
The URL is:
app.personyze.com/rest/goals
Columns
| Column | Notes |
|---|---|
id |
|
name |
|
is_active |
0 stops the goal being evaluated. Its history stays. |
goal_event_index |
Read-only. The reporting slot, 1–12, allocated when the goal is created. This is the <n> in the goal_event_<n>_* columns of summary_actions and in an A/B test's ab_goals. Never send it — the platform assigns the lowest free slot itself, and writing it by hand detaches a goal from its own reporting history. |
container_types |
What the goal is and how it is captured — see below. Required on insert. |
element |
What is watched: a CSS selector for a click goal, a URL part for a URL goal, a cookie or variable name for a data goal. |
match |
Optional regular expression the captured value must match. Its first capturing group becomes the value. |
count_once_per |
session (the default), visit, or empty to count every occurrence. A purchase goal counted per occurrence and one counted per session answer different questions; pick before the data accumulates. |
fixed_value |
A constant monetary value for each conversion, when the page does not carry one. |
value_unit |
How the value is displayed, e.g. $ *. |
match_many |
1 to record every match on the page rather than the first. |
dedicated_campaign_ids |
Makes the goal campaign-dedicated: a comma-separated list of campaign ids it reports for. Only sessions that matched one of those campaigns count, the goal takes no reporting slot (goal_event_index stays 0), does not count against the 12-goal limit, and stays out of the dashboards and account-wide reports. Every id must name an existing campaign; the list is normalized to a sorted CSV. Empty or 0 = a normal account-wide goal; on update, sending 0 converts a dedicated goal to account-wide (allocating a slot), and sending campaign ids frees an account-wide goal's slot. |
time_created |
There is a hard limit of 12 account-wide goals per account: the summary tables have goal_event_1_* through goal_event_12_* columns, so a thirteenth has nowhere to report. Deleting a goal frees its slot for reuse, and the counters in that slot are zeroed when it is reused. Campaign-dedicated goals (dedicated_campaign_ids) are outside the limit — they report as rows, per campaign, not through the slot columns — so an account can have any number of them.
container_types
A comma-separated set. It always contains goal event — that is what distinguishes a goal from a placeholder, which lives in the same table — plus one or more values saying how the value is captured:
| Goal kind | container_types |
|---|---|
| Click on an element | click event,goal event |
| Hover over an element | click event,goal event,mouse over event |
| A URL was visited | goal event,grab url |
| Value on the page | goal event,grab,grab volatile html (or grab static html if the value is present at page load and never changes) |
| Value in a meta tag | goal event,grab,grab meta tag |
| Value in a cookie | goal event,grab,grab cookie |
| Value in local / session storage | goal event,grab,grab local storage / grab session storage |
| Value in a JavaScript variable | goal event,grab,grab variable |
| Google Analytics event | goal event,grab ga |
| Tag Manager dataLayer event | goal event,grab gtm |
| Your own code reports it | custom event,goal event |
goal event on its own is refused: it says what the row is for, not how the value is captured.
Insert example
A goal that fires when a checkout button is clicked:
curl --data '{"name": "Checkout clicked", "container_types": "click event,goal event", "element": "#checkout-btn"}' 'https://api:FD09908F25BECB09D78EBEA1DADFB618651F612D@app.personyze.com/rest/goals/'
Returns the new goal's id.
Select example
curl 'https://api:FD09908F25BECB09D78EBEA1DADFB618651F612D@app.personyze.com/rest/goals/'
Update example
Only name, is_active, element, match, count_once_per, fixed_value, value_unit, match_many and dedicated_campaign_ids can be changed. The goal's kind cannot: turning a click goal into a URL goal would keep the reporting history under the same slot while measuring something else entirely, which reads as a metric that mysteriously changed shape. Create a new goal instead.
curl -X PUT --data '{"is_active": 0}' 'https://api:FD09908F25BECB09D78EBEA1DADFB618651F612D@app.personyze.com/rest/goals/where/id=23'
Delete example
curl -X DELETE 'https://api:FD09908F25BECB09D78EBEA1DADFB618651F612D@app.personyze.com/rest/goals/where/id=23'