- Request
- Responses
- 200 OK
- Body
- CounterBrief
- CodeOptionsE
- FilterE
- ActionGoal
- CompositeGoal
- DepthGoal
- EmailGoal
- FileGoal
- MessengerGoal
- PaymentSystemGoal
- PhoneGoal
- SiteSearchGoal
- SocialNetworkGoal
- UrlGoal
- VisitDurationGoal
- CounterGrantE
- AccessFiltersGrantE
- Label
- CounterMirrorE
- OperationE
- WebvisorOptions
- InformerOptionsE
- GoalCondition
- ConditionalGoal
- AccessFiltersShortE
List of available counters
Returns a list of existing counters available to the user.
Request
GET
https://api-metrika.yandex.net/management/v1/counters
Query parameters
Name |
Description |
callback |
Type: string Callback function that processes the API response. |
counter_ids |
Type: integer<int32>[] List of IDs of counters you want to get. |
favorite |
Type: boolean Filter by counters that were added to Favorites. Default: |
field |
Type: string One or several additional parameters of a returned object. The names of the additional parameters are specified in any order, separated by commas, without spaces. Example: |
label_id |
Type: integer<int32> Filter by label. |
offset |
Type: integer<int32> Serial number of the counter to start the list of counters. The first counter has the number 1. Default: |
per_page |
Type: integer<int32> Number of counters that you want to receive. Default: |
permission |
Type: string Filter by level of access to the counter. Parameter can include multiple values separated by commas:
|
reverse |
Type: boolean Display counters in ascending or descending order. Default: |
robots |
Type: boolean Whether to include robot sessions Default: |
search_string |
Type: string Filter by string. You can specify:
The response will include counters that have the specified substring in their name, site, or mirrors. To filter by ID, specify the full ID. |
sort |
Type: string Sorting:
Default: |
status |
Type: string Filter by counter status. Enabled by default.
Default: |
type |
Type: string Filter by counter type.
|
Responses
200 OK
OK
Body
application/json
{
"rows": 0,
"counters": [
{
"id": 0,
"status": "string",
"owner_login": "string",
"activity_status": "string",
"name": "string",
"type": "string",
"favorite": false,
"permission": "string",
"goals": [
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string",
"conditions": [
{
"type": "string",
"url": "string"
}
],
"flag": "basket"
},
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string",
"steps": [
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string",
"conditions": [
{
"type": "string",
"url": "string"
}
],
"flag": "string"
}
]
},
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string",
"depth": 0
},
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string",
"conditions": [
{
"type": "string",
"url": "string"
}
],
"flag": "basket"
},
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string",
"conditions": [
{
"type": "string",
"url": "string"
}
],
"flag": "basket"
},
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string",
"conditions": [
{
"type": "string",
"url": "string"
}
],
"flag": "basket"
},
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string"
},
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string",
"conditions": [
{
"type": "string",
"url": "string"
}
],
"flag": "basket",
"hide_phone_number": false
},
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string",
"conditions": [
{
"type": "string",
"url": "string"
}
],
"flag": "basket"
},
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string",
"conditions": [
{
"type": "string",
"url": "string"
}
],
"flag": "basket"
},
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string",
"conditions": [
{
"type": "string",
"url": "string"
}
],
"flag": "basket"
},
{
"id": 0,
"name": "string",
"type": "string",
"default_price": 0,
"goal_source": "string",
"is_favorite": false,
"status": "string",
"duration": 0
}
],
"filters": [
{
"id": 0,
"attr": "string",
"type": "string",
"value": "string",
"action": "string",
"status": "string",
"start_ip": "string",
"end_ip": "string",
"with_subdomains": false
}
],
"operations": [
{
"id": 0,
"action": "string",
"attr": "string",
"value": "string",
"status": "string"
}
],
"grants": [
{
"user_login": "string",
"perm": "string",
"created_at": "2022-12-29T18:02:01Z",
"comment": "string",
"partner_data_access": false
},
{
"user_login": "string",
"perm": "string",
"created_at": "2022-12-29T18:02:01Z",
"comment": "string",
"partner_data_access": false,
"access_filters": [
{
"id": 0,
"name": "string"
}
]
}
],
"labels": [
{
"id": 0,
"name": "string"
}
],
"webvisor": {
"urls": "string",
"arch_enabled": false,
"arch_type": "string",
"load_player_type": "string",
"wv_version": 0,
"wv_forms": false
},
"code_options": {
"async": false,
"informer": {
"enabled": false,
"type": "string",
"size": 0,
"indicator": "string",
"color_start": "FFFFFFFF.",
"color_end": "EFEFEFFF",
"color_text": 0,
"color_arrow": 0
},
"visor": false,
"track_hash": false,
"xml_site": false,
"clickmap": false,
"in_one_line": false,
"ecommerce": false,
"alternative_cdn": false,
"ytm": false
},
"create_time": "2022-12-29T18:02:01Z",
"time_zone_name": "string",
"time_zone_offset": 0,
"source": "string",
"site2": {
"site": "string"
},
"gdpr_agreement_accepted": false,
"mirrors2": [
{
"site": "string"
}
]
}
]
}
Name |
Description |
counters |
Type: CounterBrief[] List of counters. |
rows |
Type: integer<int32> Number of counters that match the request, excluding the |
CounterBrief
Name |
Description |
activity_status |
Type: string Counter traffic. Possible values:
|
code_options |
Type: CodeOptionsE Counter code settings. |
create_time |
Type: string<date-time> Date and time when the counter was created. |
favorite |
Type: boolean Whether the counter is added to favorites:
|
filters |
Type: FilterE[] List of structures with information on counter filters. |
gdpr_agreement_accepted |
Type: boolean Acceptance of the Yandex Metrica Data Processing Agreement.
|
goals |
Type: (ActionGoal or CompositeGoal or DepthGoal or EmailGoal or FileGoal or MessengerGoal or PaymentSystemGoal or PhoneGoal or SiteSearchGoal or SocialNetworkGoal or UrlGoal or VisitDurationGoal)[] List of structures with information on counter goals. |
grants |
Type: (CounterGrantE or AccessFiltersGrantE)[] |
id |
Type: integer<int32> Counter ID. |
labels |
Type: Label[] List of structures with information on labels. |
mirrors2 |
Type: CounterMirrorE[] List of site mirrors (domains). |
name |
Type: string Counter name. Min length: Max length: |
operations |
Type: OperationE[] List of structures with information on counter actions. |
owner_login |
Type: string Login of the counter owner. |
permission |
Type: string Level of access to the counter:
|
site2 |
Type: CounterMirrorE List of site mirrors (domains). |
source |
Type: string Counter type. Possible values:
|
status |
Type: string Counter status. Possible values:
|
time_zone_name |
Type: string Time zone for calculating statistics. |
time_zone_offset |
Type: integer<int32> Current time zone offset from GMT (minutes). |
type |
Type: string Counter type. Possible values:
|
webvisor |
Type: WebvisorOptions Structure with information on Session Replay settings. |
CodeOptionsE
Counter code settings.
Name |
Description |
alternative_cdn |
Type: boolean This option ensures accurate tracking of sessions from regions where access to Yandex services is restricted. It might take longer to load the counter code when using this option:
|
async |
Type: boolean Asynchronous counter code:
|
clickmap |
Type: boolean Gathering statistics for the Click Map report:
|
ecommerce |
Type: boolean Collecting E-commerce data:
|
in_one_line |
Type: boolean Print a counter code as a single string:
|
informer |
Type: InformerOptionsE Informer settings. |
track_hash |
Type: boolean Hash tracking in the browser address bar. The option applies to AJAX sites:
|
visor |
Type: boolean Record and analysis of site user behavior:
|
xml_site |
Type: boolean For XML sites. The "noscript" element can't be used in XML documents:
|
ytm |
Type: boolean Whether the counter management system is used. Possible values:
|
FilterE
List of structures with information on counter filters.
Name |
Description |
action* |
Type: string Filter type:
|
attr* |
Type: string Data type the filter is applied to:
|
status* |
Type: string Filter status:
|
type* |
Type: string Filter type or action for filter:
|
end_ip |
Type: string The last IP address in the range. |
id |
Type: integer<int32> Filter ID. Specify this parameter when changing a counter filter. |
start_ip |
Type: string The first IP address in the range. |
value |
Type: string Filter value. |
with_subdomains |
Type: boolean Filter by subdomain. |
ActionGoal
JavaScript event.
Name |
Description |
name* |
Type: string Goal name. Min length: Max length: |
type* |
Type: string Goal type:
|
conditions |
Type: GoalCondition[] List of structures with the goal conditions. |
default_price |
Type: number<double> Default goal cost. |
flag |
Type: string Goal type for Yandex Market clients:
Enum: |
goal_source |
Type: string Indicates how the goal was created:
|
id |
Type: integer<int64> 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 |
CompositeGoal
Multi-step goal.
Used for grouping and setting the order of usual goals.
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.
Name |
Description |
name* |
Type: string Goal name. Min length: Max length: |
steps* |
Type: ConditionalGoal[] List of steps in a multi-step goal. Min items: Max items: |
type* |
Type: string Goal type:
|
default_price |
Type: number<double> Default goal cost. |
goal_source |
Type: string Indicates how the goal was created:
|
id |
Type: integer<int64> 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 |
DepthGoal
Page depth. The goal is considered achieved if the user viewed the specified number of site pages.
Name |
Description |
depth* |
Type: integer<int64> Number of pages viewed by the user. Min value: |
name* |
Type: string Goal name. Min length: Max length: |
type* |
Type: string Goal type:
|
default_price |
Type: number<double> Default goal cost. |
goal_source |
Type: string Indicates how the goal was created:
|
id |
Type: integer<int64> 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 |
EmailGoal
Clicks or taps on an email address.
Name |
Description |
name* |
Type: string Goal name. Min length: Max length: |
type* |
Type: string Goal type:
|
conditions |
Type: GoalCondition[] List of structures with the goal conditions. |
default_price |
Type: number<double> Default goal cost. |
flag |
Type: string Goal type for Yandex Market clients:
Enum: |
goal_source |
Type: string Indicates how the goal was created:
|
id |
Type: integer<int64> 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 |
FileGoal
File download. The goal is considered achieved if the user downloaded any file or a specific file.
Name |
Description |
name* |
Type: string Goal name. Min length: Max length: |
type* |
Type: string Goal type:
|
conditions |
Type: GoalCondition[] List of structures with the goal conditions. |
default_price |
Type: number<double> Default goal cost. |
flag |
Type: string Goal type for Yandex Market clients:
Enum: |
goal_source |
Type: string Indicates how the goal was created:
|
id |
Type: integer<int64> 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 |
MessengerGoal
Click-through to a messaging app. The goal will be achieved once the user clicks the link to the messaging app.
Name |
Description |
name* |
Type: string Goal name. Min length: Max length: |
type* |
Type: string Goal type:
|
conditions |
Type: GoalCondition[] List of structures with the goal conditions. |
default_price |
Type: number<double> Default goal cost. |
flag |
Type: string Goal type for Yandex Market clients:
Enum: |
goal_source |
Type: string Indicates how the goal was created:
|
id |
Type: integer<int64> 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 |
PaymentSystemGoal
Payment systems. The goal is considered achieved if the user makes a payment via a payment system.
Name |
Description |
name* |
Type: string Goal name. Min length: Max length: |
type* |
Type: string Goal type:
|
default_price |
Type: number<double> Default goal cost. |
goal_source |
Type: string Indicates how the goal was created:
|
id |
Type: integer<int64> 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 |
PhoneGoal
Clicks or taps on the phone number.
Name |
Description |
name* |
Type: string Goal name. Min length: Max length: |
type* |
Type: string Goal type:
|
conditions |
Type: GoalCondition[] List of structures with the goal conditions. |
default_price |
Type: number<double> Default goal cost. |
flag |
Type: string Goal type for Yandex Market clients:
Enum: |
goal_source |
Type: string Indicates how the goal was created:
|
hide_phone_number |
Type: boolean Hide the phone number on desktop devices. |
id |
Type: integer<int64> 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 |
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.
Name |
Description |
name* |
Type: string Goal name. Min length: Max length: |
type* |
Type: string Goal type:
|
conditions |
Type: GoalCondition[] List of structures with the goal conditions. |
default_price |
Type: number<double> Default goal cost. |
flag |
Type: string Goal type for Yandex Market clients:
Enum: |
goal_source |
Type: string Indicates how the goal was created:
|
id |
Type: integer<int64> 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 |
SocialNetworkGoal
Click-through to a social network. The goal will be achieved once the user clicks the link to the social network.
Name |
Description |
name* |
Type: string Goal name. Min length: Max length: |
type* |
Type: string Goal type:
|
conditions |
Type: GoalCondition[] List of structures with the goal conditions. |
default_price |
Type: number<double> Default goal cost. |
flag |
Type: string Goal type for Yandex Market clients:
Enum: |
goal_source |
Type: string Indicates how the goal was created:
|
id |
Type: integer<int64> 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 |
UrlGoal
Pageviews. Achieved when at least one condition is met.
Name |
Description |
name* |
Type: string Goal name. Min length: Max length: |
type* |
Type: string Goal type:
|
conditions |
Type: GoalCondition[] List of structures with the goal conditions. |
default_price |
Type: number<double> Default goal cost. |
flag |
Type: string Goal type for Yandex Market clients:
Enum: |
goal_source |
Type: string Indicates how the goal was created:
|
id |
Type: integer<int64> 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 |
VisitDurationGoal
Session duration. The goal will be achieved if the session duration exceeds the specified one.
Name |
Description |
name* |
Type: string Goal name. Min length: Max length: |
type* |
Type: string Goal type:
|
default_price |
Type: number<double> Default goal cost. |
duration |
Type: integer<int32> Session duration in seconds. Min value: |
goal_source |
Type: string Indicates how the goal was created:
|
id |
Type: integer<int64> 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 |
CounterGrantE
List of structures with information on access rights to the counter.
Name |
Description |
perm* |
Type: string Access level:
|
comment |
Type: string Custom comment. The maximum number of characters is 255. Min length: Max length: |
created_at |
Type: string<date-time> Date when the permission was granted in YYYY-MM-DD'T'hh:mm:ssZ format. |
partner_data_access |
Type: boolean Access to the Monetization report group. The user can view reports and add dimensions and metrics from the Monetization group to other reports. Users with edit permissions already have access to the reports within the "Monetization" group. Possible values:
|
user_login |
Type: string Login of a user with counter management rights. This parameter contains an empty string if counter statistics are in public access ( |
AccessFiltersGrantE
Name |
Description |
access_filters* |
Type: AccessFiltersShortE[] List of access filters granted to the user. Min items: Max items: |
perm* |
Type: string Access level:
|
comment |
Type: string Custom comment. The maximum number of characters is 255. Min length: Max length: |
created_at |
Type: string<date-time> Date when the permission was granted in YYYY-MM-DD'T'hh:mm:ssZ format. |
partner_data_access |
Type: boolean Access to the Monetization report group. The user can view reports and add dimensions and metrics from the Monetization group to other reports. Users with edit permissions already have access to the reports within the "Monetization" group. Possible values:
|
user_login |
Type: string Login of a user with counter management rights. This parameter contains an empty string if counter statistics are in public access ( |
Label
Label.
Name |
Description |
id |
Type: integer<int32> Label ID. |
name |
Type: string Label name. Min length: Max length: |
CounterMirrorE
List of site mirrors (domains).
Name |
Description |
site* |
Type: string Full site domain. Min length: Max length: |
OperationE
List of structures with information on counter actions.
Name |
Description |
action* |
Type: string Action type:
|
attr* |
Type: string Field for filtering:
|
status* |
Type: string Action status:
|
id |
Type: integer<int32> Action ID (needs to be specified while changing a counter action). |
value |
Type: string Value for replacement. |
WebvisorOptions
Structure with information on Session Replay settings.
Name |
Description |
arch_enabled |
Type: boolean Saving site pages:
|
arch_type |
Type: string Recording page content:
|
load_player_type |
Type: string Loading pages in the player:
|
urls |
Type: string List of pages for saving. Min length: Max length: |
wv_forms |
Type: boolean Records the content of fields and forms:
|
wv_version |
Type: integer<int32> Session Replay version. |
InformerOptionsE
Informer settings.
Name |
Description |
color_arrow |
Type: integer<int32> Color of the arrow in the informer:
Min value: Max value: |
color_end |
Type: string End (bottom) color of the informer in RRGGBBAA format. This parameter is used to create a background gradient. You can set color saturation and transparency the same way as with the "color_start" parameter. Default: Pattern: |
color_start |
Type: string The color at the top of the informer, specified in RRGGBBAA format. RR, GG, BB are saturated red, green, and blue colors. Saturation for each color is specified using a value from 00 to FF. AA: transparency, from 00 (transparent) to FF (opaque). Default: Pattern: |
color_text |
Type: integer<int32> Color of the text in the informer:
Min value: Max value: |
enabled |
Type: boolean Permission to display the informer:
|
indicator |
Type: string The parameter that will be shown on the informer:
|
size |
Type: integer<int32> Informer size:
Min value: Max value: |
type |
Type: string Informer type:
|
GoalCondition
List of structures with the goal conditions.
Name |
Description |
type* |
Type: string Condition type:
|
url |
Type: string The value depends on the goal type:
|
ConditionalGoal
List of steps in a multi-step goal.
Name |
Description |
name* |
Type: string Goal name. Min length: Max length: |
type* |
Type: string Goal type:
|
conditions |
Type: GoalCondition[] List of structures with the goal conditions. |
default_price |
Type: number<double> Default goal cost. |
flag |
Type: string Goal type for Yandex Market clients:
|
goal_source |
Type: string Indicates how the goal was created:
|
id |
Type: integer<int64> 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 |
AccessFiltersShortE
List of access filters granted to the user.
Name |
Description |
id |
Type: integer<int32> Access filter ID. |
name |
Type: string Access filter name. |
No longer supported, please use an alternative and newer version.