List of goals
Returns information about counter goals.
Request
GET
https://api-metrika.yandex.net/management/v1/counter/{counterId}/goals
Path parameters
|
Name |
Description |
|
counterId |
Type: integer ID of the counter for which you want to get a list of goals. |
Query parameters
|
Name |
Description |
|
callback |
Type: string Callback function that processes the API response. Example: `` |
|
useDeleted |
Type: boolean Information on deleted goals. Default: |
Responses
200 OK
OK
Body
application/json
{
"goals": [
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"conditions": [
null
],
"prev_goal_id": 0,
"flag": "example"
}
]
}
|
Name |
Description |
|
goals |
Type: arrayOne of 13 types
List of structures with information on counter goals. Example
|
GoalE
|
Name |
Description |
|
name |
Type: string Goal name. Min length: Max length: Example: |
|
type |
Type: string Goal type:
Example: |
|
default_price |
Type: number Default goal cost. |
|
goal_source |
Type: string Indicates how the goal was created:
Example: |
|
id |
Type: integer ID of the goal. Specify this parameter when changing and deleting a counter goal. |
|
is_favorite |
Type: boolean Whether the goal is favorite:
|
|
status |
Type: string Example: |
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"goal_source": "example",
"is_favorite": true,
"status": "example"
}
GoalCondition
List of structures with the goal conditions.
|
Name |
Description |
|
type |
Type: string Condition type:
Example: |
|
url |
Type: string The value depends on the goal type:
Example: |
Example
{
"type": "example",
"url": "example"
}
ActionGoal
JavaScript event.
All of 2 types
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" } -
Type: object
conditions
Type: GoalCondition[]
Example
[ { "type": "example", "url": "example" } ]flag
Type: string
Goal type for Yandex Market clients:
basket: Shopping cart, shopping cart page.order: Order, order confirmation page.
Example:
exampleExample
{ "conditions": [ { "type": "example", "url": "example" } ], "flag": "example" }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"conditions": [
{
"type": "example",
"url": "example"
}
],
"flag": "example"
}
ChatGoalCondition
List of structures with the goal conditions.
|
Name |
Description |
|
field |
Type: string What the goal applies to. Example: |
Example
{
"field": "example"
}
ChatGoalConditionAnswered
All of 2 types
-
Type: ChatGoalCondition
List of structures with the goal conditions.
Example
{ "field": "example" } -
Type: object
answered
Type: boolean
Status of a chat response.
Example
{ "answered": true }
Example
{
"field": "example",
"answered": true
}
ChatGoalConditionPlatform
All of 2 types
-
Type: ChatGoalCondition
List of structures with the goal conditions.
Example
{ "field": "example" } -
Type: object
platform
Type: string
Chat platform. Possible values:
telegramviberwhatsApp
Example:
telegramExample
{ "platform": "telegram" }
Example
{
"field": "example",
"platform": "telegram"
}
ChatGoalConditionTag
All of 2 types
-
Type: ChatGoalCondition
List of structures with the goal conditions.
Example
{ "field": "example" } -
Type: object
operator
Type: string
Condition type. Possible values:
contain: Contains.exact: Matches exactly.start: Starts with.regexp: Matches a regular expression.
Example:
examplevalue
Type: string
Min length:
1Max length:
1024Example:
exampleExample
{ "operator": "example", "value": "example" }
Example
{
"field": "example",
"operator": "example",
"value": "example"
}
ChatGoal
Click or tap on a chat.
All of 2 types
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" } -
Type: object
conditions
Type: array
One of 3 types
-
Type: ChatGoalConditionAnswered
Example
{ "field": "example", "answered": true } -
Type: ChatGoalConditionPlatform
Example
{ "field": "example", "platform": "telegram" } -
Type: ChatGoalConditionTag
Example
{ "field": "example", "operator": "example", "value": "example" }
Example
[ { "field": "example", "answered": true } ]Example
{ "conditions": [ { "field": "example", "answered": true } ] } -
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"conditions": [
null
]
}
ConditionalGoal
List of steps in a multi-step goal.
|
Name |
Description |
|
name |
Type: string Goal name. Min length: Max length: Example: |
|
type |
Type: string Goal type:
Example: |
|
conditions |
Type: GoalCondition[] Example
|
|
default_price |
Type: number Default goal cost. |
|
flag |
Type: string Goal type for Yandex Market clients:
Example: |
|
goal_source |
Type: string Indicates how the goal was created:
Example: |
|
id |
Type: integer ID of the goal. Specify this parameter when changing and deleting a counter goal. |
|
is_favorite |
Type: boolean Whether the goal is favorite:
|
|
status |
Type: string Example: |
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"conditions": [
{
"type": "example",
"url": "example"
}
],
"flag": "example"
}
CompositeGoal
Multi-step goal. Used for grouping and setting the order of usual goals. The "Page view" and "JavaScript event" goals can be steps of a multi-step goal. A step is considered completed if all the previous steps were completed and all the current step's conditions were met.
All of 2 types
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" } -
Type: object
steps
Type: ConditionalGoal[]
Min items:
0Max items:
5Example
[ { "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example", "conditions": [ { "type": "example", "url": "example" } ], "prev_goal_id": 0, "flag": "example" } ]Example
{ "steps": [ { "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example", "conditions": [ { "type": "example", "url": "example" } ], "prev_goal_id": 0, "flag": "example" } ] }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"steps": [
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"conditions": [
{}
],
"prev_goal_id": 0,
"flag": "example"
}
]
}
DepthGoal
Page depth. The goal is considered achieved if the user viewed the specified number of site pages.
All of 2 types
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" } -
Type: object
depth
Type: integer
Number of pages viewed by the user.
Min value:
2Example
{ "depth": 2 }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"depth": 2
}
EmailGoal
Clicks or taps on an email address.
All of 2 types
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" } -
Type: object
conditions
Type: GoalCondition[]
Example
[ { "type": "example", "url": "example" } ]flag
Type: string
Goal type for Yandex Market clients:
basket: Shopping cart, shopping cart page.order: Order, order confirmation page.
Example:
exampleExample
{ "conditions": [ { "type": "example", "url": "example" } ], "flag": "example" }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"conditions": [
{
"type": "example",
"url": "example"
}
],
"flag": "example"
}
FileGoal
File download. The goal is considered achieved if the user downloaded any file or a specific file.
All of 2 types
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" } -
Type: object
conditions
Type: GoalCondition[]
Example
[ { "type": "example", "url": "example" } ]flag
Type: string
Goal type for Yandex Market clients:
basket: Shopping cart, shopping cart page.order: Order, order confirmation page.
Example:
exampleExample
{ "conditions": [ { "type": "example", "url": "example" } ], "flag": "example" }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"conditions": [
{
"type": "example",
"url": "example"
}
],
"flag": "example"
}
MessengerGoal
Click-through to a messaging app. The goal will be achieved once the user clicks the link to the messaging app.
All of 2 types
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" } -
Type: object
conditions
Type: GoalCondition[]
Example
[ { "type": "example", "url": "example" } ]flag
Type: string
Goal type for Yandex Market clients:
basket: Shopping cart, shopping cart page.order: Order, order confirmation page.
Example:
exampleExample
{ "conditions": [ { "type": "example", "url": "example" } ], "flag": "example" }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"conditions": [
{
"type": "example",
"url": "example"
}
],
"flag": "example"
}
PaymentSystemGoal
Payment systems. The goal is considered achieved if the user makes a payment via a payment system.
All of 1 type
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example"
}
PhoneGoal
Clicks or taps on the phone number.
All of 2 types
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" } -
Type: object
conditions
Type: GoalCondition[]
Example
[ { "type": "example", "url": "example" } ]flag
Type: string
Goal type for Yandex Market clients:
basket: Shopping cart, shopping cart page.order: Order, order confirmation page.
Example:
examplehide_phone_number
Type: boolean
Hide the phone number on desktop devices.
Example
{ "conditions": [ { "type": "example", "url": "example" } ], "flag": "example", "hide_phone_number": true }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"conditions": [
{
"type": "example",
"url": "example"
}
],
"flag": "example",
"hide_phone_number": true
}
SiteSearchGoal
Site search. The goal will be achieved when performing a site search if there is at least one match in the URL specified in the GET parameters.
All of 2 types
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" } -
Type: object
conditions
Type: GoalCondition[]
Example
[ { "type": "example", "url": "example" } ]flag
Type: string
Goal type for Yandex Market clients:
basket: Shopping cart, shopping cart page.order: Order, order confirmation page.
Example:
exampleExample
{ "conditions": [ { "type": "example", "url": "example" } ], "flag": "example" }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"conditions": [
{
"type": "example",
"url": "example"
}
],
"flag": "example"
}
SocialNetworkGoal
Click-through to a social network. The goal will be achieved once the user clicks the link to the social network.
All of 2 types
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" } -
Type: object
conditions
Type: GoalCondition[]
Example
[ { "type": "example", "url": "example" } ]flag
Type: string
Goal type for Yandex Market clients:
basket: Shopping cart, shopping cart page.order: Order, order confirmation page.
Example:
exampleExample
{ "conditions": [ { "type": "example", "url": "example" } ], "flag": "example" }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"conditions": [
{
"type": "example",
"url": "example"
}
],
"flag": "example"
}
UrlGoal
Pageviews. Achieved when at least one condition is met.
All of 2 types
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" } -
Type: object
conditions
Type: GoalCondition[]
Example
[ { "type": "example", "url": "example" } ]flag
Type: string
Goal type for Yandex Market clients:
basket: Shopping cart, shopping cart page.order: Order, order confirmation page.
Example:
exampleExample
{ "conditions": [ { "type": "example", "url": "example" } ], "flag": "example" }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"conditions": [
{
"type": "example",
"url": "example"
}
],
"flag": "example"
}
VisitDurationGoal
Session duration. The goal will be achieved if the session duration exceeds the specified one.
All of 2 types
-
Type: GoalE
Example
{ "id": 0, "name": "example", "type": "example", "default_price": 0.5, "is_retargeting": true, "goal_source": "example", "is_favorite": true, "status": "example" } -
Type: object
duration
Type: integer
Session duration in seconds.
Min value:
1Example
{ "duration": 1 }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"goal_source": "example",
"is_favorite": true,
"status": "example",
"duration": 1
}
LocationOnPage
|
Name |
Description |
|
path |
Type: string Location on the page Min length: Max length: Example: |
|
type_of_path |
Type: string Type of the specified location Example: |
Example
{
"type_of_path": "example",
"path": "example"
}
No longer supported, please use an alternative and newer version.