Version 2 Goals
Introduction
Goals are groups of triggers that have matched some business criteria based on rules.
- Each Goal is given a numeric ID which can be used to reference it in the APIs.
- A Trigger can be marked with a single Goal ID.
- Each Goal can be configured with 1 or more Goal Ranges which specify which triggers should be marked as this Goal.
- Goals Ranges contain rules that are activated for a given date range.
- A Goal ID of 0 is used to indicate a trigger has no Goal.
- Goals can be assigned an order number and are actioned in ascending order.
Goal Properties
- goalId (integer) - An integer with the Goal ID.
- goalTitle (string) - Title of the Goal.
- goalDescription (string) - Description of the Goal.
- goalOrder (integer) - An integer detailing the order of the goals.
- deDupeFields (array) - An array of comma delimited values.
- deDupeLookback (integer) - An integer with the number of days deduplication is applied.
- goalStatus (integer) - An integer representing goal status: 200 - active, 410 - inactive.
- criteriaConfig (array) - Array of criteria (each containing a field, op, and value).
- actionConfig (array) - Optional array of actions (each containing a mode and/or args).
Goal Range Properties
Goal ranges are now DEPRECATED - use the criteriaConfig and actionConfig properties of the goal instead
- criteria (array) - Array of criteria (each containing a field, op, and value).
- action (array) - Optional array of actions (each containing a mode and/or args).
- startDatetime (datetime) - Datetime.
Goal Criteria Fields
Goal criteria fields may be any of those defined in the trigger reports (see Field Definitions), except for the following fields:
- attribution… - None of the attribution fields are suitable for criteria.
- goal - This is not yet defined when deciding the trigger’s goal.
- goalTitle - This is not yet defined when deciding the trigger’s goal.
- goalValue - This is not yet defined when deciding the trigger’s goal.
- goalCurrency - This is not yet defined when deciding the trigger’s goal.
List Goals for an IGRP
This lists the Goals configured for an IGRP.
Request:
GET /config/v2/igrps/{IGRP SPECIFIER}/goals
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
GET Params
- filter (array) OPTIONAL - One or more filters.
- sort (array) OPTIONAL - One or more sorting params.
- limit (integer) OPTIONAL - Limit on the result set.
-
offset (integer) OPTIONAL - Offset of the result set.
- includeDeleted (int) OPTIONAL - A flag (1 or 0) to show deleted goals on the request. Defaults to 0.
Filter Types
The Goals list may be filtered by any of the returned fields. Additionally Goals can be filtered by goalGroupId
and goalGroupTypeId
.
Sort Types
The Goals list may be sorted by any of the returned fields. Additionally Goals can be sorted by goalGroupId
and goalGroupTypeId
.
Response:
Returns a list of Goals.
- goalId (integer) - Goal ID.
- goalTitle (string) - Goal Title.
- goalDescription (string) - Goal Description.
- goalOrder (integer) - Goal Order number.
- deDupeFields (array) - An array of fields.
- deDupeLookbackDays (integer) - An integer with the number of days deduplication is applied.
- goalStatus (integer) - Goal status. See goal properties.
- criteriaConfig (array) - Array of criteria (each containing a field, op, and value).
- actionConfig (array) - Optional array of actions (each containing a mode and/or args).
{"goalId":"100","goalTitle":"Call Pass","goalDescription":"Test goal 1","goalOrder":"0","deDupeFields":[["test1"]],"deDupeLookbackDays":"60","goalStatus":200,"actionConfig":[{"mode":"test","args":"test"}],"criteriaConfig":[{"field":"act","op":"eq","value":"call"}]}
{"goalId":"101","goalTitle":"New Goal","goalDescription":"Test goal 2","goalOrder":"1","deDupeFields":[["test2"]],"deDupeLookbackDays":"30","goalStatus":410,"actionConfig":[{"mode":"test","args":"test"}],"criteriaConfig":[{"field":"act","op":"eq","value":"call"}]}
Read Goal
Read Goal details for the specified Goal and IGRP.
Request:
GET /config/v2/igrps/{IGRP SPECIFIER}/goals/{GOAL SPECIFIER}
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
- GOAL SPECIFIER (int) - Goal ID.
Response:
{"goalId":"2","goalTitle":"testGoal","goalDescription":"testDesc","goalOrder":"2","deDupeFields":[["vid"]],"deDupeLookbackDays":"90","goalStatus":200,"actionConfig":[{"mode":"test","args":"test"}],"criteriaConfig":[{"field":"act","op":"eq","value":"call"}]}
Create Goal
This creates a new Goal for an IGRP.
Request:
POST /config/v2/igrps/{IGRP SPECIFIER}/goals
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
POST Params
- goalTitle (string) - Title of the Goal.
- goalDescription (string) - Description of the Goal.
- goalOrder (int) - Goal Order number.
- deDupeFields (array) - An array of fields
- deDupeLookbackDays (int) - The number of days deduplication is applied.
- goalStatus (integer) OPTIONAL - Goal status. Default: 200.
- criteriaConfig (array) OPTIONAL - Array of criteria (each containing a field, op, and value).
- actionConfig (array) OPTIONAL - Optional array of actions (each containing a mode and/or args).
Response:
{"goalId":"2"}
Update Goal Config
Updates the configuration of an existing Goal.
Request:
POST /config/v2/igrps/{IGRP SPECIFIER}/goals/{GOAL SPECIFIER}
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
- GOAL SPECIFIER (int) - Goal ID.
POST Params
- goalTitle (string) - Title of the Goal.
- goalDescription (string) - Description of the Goal.
- goalOrder (int) - Goal Order number.
- deDupeFields (array) - An array of fields
- deDupeLookbackDays (int) - The number of days deduplication is applied.
- criteriaConfig (array) OPTIONAL - Array of criteria (each containing a field, op, and value).
- actionConfig (array) OPTIONAL - Optional array of actions (each containing a mode and/or args).
Response:
Returns the HTTP 204 (No Content) status code if update successful.
HTTP 204 - NO CONTENT
Delete Goal Config
Remove existing Goal.
Request:
DELETE /config/v2/igrps/{IGRP SPECIFIER}/goals/{GOAL SPECIFIER}
Goal Params
- IGRP SPECIFIER (int) - Installation ID.
- GOAL SPECIFIER (int) - Goal ID.
Response:
Returns the HTTP 204 (No Content) status code if delete successful.
HTTP 204 - NO CONTENT
Order Goal Config
Sets the goals order.
Request:
PUT /config/v2/igrps/{IGRP SPECIFIER}/goals/order
URL Path Params
- IGRP SPECIFIER (int) - Installation ID.
PUT Params
- sortedGoals (array) - Array of goal IDs, with the array index to be used as the order.
Response:
HTTP 204 - NO CONTENT
Required Criteria
All goals require an action set in the criteria to define what actions the goal should be triggered for. See examples below
Visits to a particular page
{"criteria":[{"field":"act","op":"in","value":"land,page"},{"field":"href","op":"eq","value":"http://www.example.com/some/page.html"}]}
Calls over 60 seconds
{"criteria":[{"field":"act","op":"eq","value":"call"},{"field":"bridgeDuration","op":"gt","value":"60"}]}
Response:
Returns the HTTP response code to reflect the request outcome.
HTTP 204 - NO CONTENT