- Request
- Query parameters
- Body
- GoalE
- GoalCondition
- ActionGoal
- ChatGoalCondition
- ChatGoalConditionAnswered
- ChatGoalConditionPlatform
- ChatGoalConditionTag
- ChatGoal
- ConditionalGoal
- CompositeGoal
- DepthGoal
- EmailGoal
- FileGoal
- MessengerGoal
- PaymentSystemGoal
- PhoneGoal
- SiteSearchGoal
- SocialNetworkGoal
- UrlGoal
- VisitDurationGoal
- FilterE
- OperationE
- CounterGrantE
- AccessFiltersShortE
- AccessFiltersGrantE
- Label
- WebvisorOptions
- InformerOptionsE
- CodeOptionsE
- PublisherOptions
- CounterMirrorE
- CounterCms
- CounterCrm
- SiteActivityProfile
- CounterFlags
- LocationOnPage
- CounterFull
- CommunicationChannel
- CounterIndustry
- UserActivityProfile
- Responses
- 200 OK
Creating a counter
Creates a counter with set parameters. A single user can create no more than 100,000 counters.
Request
POST
https://api-metrika.yandex.net/management/v1/counters
Query parameters
|
Name |
Description |
|
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: Example: `` |
|
ytm |
Type: boolean Whether the counter management system is used. Default: |
Body
application/json
{
"counter": {
"id": 0,
"status": "example",
"owner_login": "example",
"activity_status": "example",
"name": "example",
"type": "example",
"favorite": true,
"hide_address": true,
"pro": true,
"pro_features": [
"example"
],
"permission": "example",
"goals": [
null
],
"filters": [
{
"id": 0,
"attr": "example",
"type": "example",
"value": "example",
"action": "example",
"status": "example",
"start_ip": "example",
"end_ip": "example",
"with_subdomains": true
}
],
"operations": [
{
"id": 0,
"action": "example",
"attr": "example",
"value": "example",
"status": "example"
}
],
"grants": [
{
"user_login": "example",
"user_uid": 0,
"perm": "example",
"created_at": "2025-01-01T00:00:00Z",
"comment": "example",
"email": "example",
"partner_data_access": true
}
],
"labels": [
{
"id": 0,
"name": "example"
}
],
"webvisor": {
"urls": "example",
"arch_enabled": true,
"arch_type": "example",
"load_player_type": "example",
"wv_version": 0,
"wv_forms": true
},
"code_options": {
"async": true,
"informer": {
"enabled": true,
"type": "example",
"size": 1,
"indicator": "example",
"color_start": "FFFFFFFF.",
"color_end": "EFEFEFFF",
"color_text": 0,
"color_arrow": 0
},
"visor": true,
"track_hash": true,
"xml_site": true,
"clickmap": true,
"in_one_line": true,
"ecommerce": true,
"alternative_cdn": true,
"ecommerce_object": "example",
"ssr": true
},
"create_time": "2025-01-01T00:00:00Z",
"time_zone_name": "example",
"time_zone_offset": 0,
"partner_id": 0,
"title": "example",
"grants_cnt": 0,
"update_time": "example",
"delete_time": "example",
"code": "example",
"filter_robots": 1,
"currency": 0,
"currency_code": "example",
"visit_threshold": 1800,
"max_goals": 0,
"max_operations": 0,
"max_filters": 0,
"features": [
"example"
],
"publisher_options": {
"enabled": true,
"schema": "example",
"schema_options": [
"example"
]
},
"total_geo_points_count": 0,
"selected_geo_points_count": 0,
"vendor_id": 0,
"site2": {
"site": "example",
"domain": "example",
"status": "example"
},
"gdpr_agreement_accepted": true,
"mirrors2": [
null
],
"cms": {
"code": "example",
"custom": "example"
},
"crm": {
"code": "example",
"custom": "example"
},
"communication_channel": [
{
"code": "example",
"custom": "example"
}
],
"industry": [
{
"code": "example",
"custom": "example"
}
],
"site_activity": {
"code": "example",
"custom": "example"
},
"user_activity": [
{
"code": "example",
"custom": "example"
}
],
"autogoals_enabled": true,
"ecommerce_deduplicator_enabled": true,
"counter_flags": {
"counter_id": 0,
"use_in_benchmarks": true,
"direct_allow_use_goals_without_access": true,
"incognito": "example",
"collect_first_party_data": true,
"collect_masked_first_party_data": true,
"statistics_over_site": true,
"measurement_enabled": true,
"vendor_data": true,
"allow_use_data_to_collect_feedback": true
},
"measurement_tokens": [
"example"
]
}
}
|
Name |
Description |
|
counter |
Type: CounterFull Counter. 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. |
|
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,
"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, "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,
"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, "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,
"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: |
|
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,
"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, "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, "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, "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,
"is_favorite": true,
"status": "example",
"steps": [
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"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, "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,
"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, "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,
"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, "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,
"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, "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,
"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, "is_favorite": true, "status": "example" }
Example
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"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, "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,
"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, "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,
"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, "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,
"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, "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,
"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, "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,
"is_favorite": true,
"status": "example",
"duration": 1
}
FilterE
List of structures with information on counter filters.
|
Name |
Description |
|
action |
Type: string Filter type:
Example: |
|
attr |
Type: string Data type the filter is applied to:
Example: |
|
status |
Type: string Filter status:
Example: |
|
type |
Type: string Filter type or action for filter:
Example: |
|
end_ip |
Type: string The last IP address in the range. Example: |
|
id |
Type: integer Filter ID. Specify this parameter when changing a counter filter. |
|
start_ip |
Type: string The first IP address in the range. Example: |
|
value |
Type: string Filter value. Example: |
|
with_subdomains |
Type: boolean Filter by subdomain. |
Example
{
"id": 0,
"attr": "example",
"type": "example",
"value": "example",
"action": "example",
"status": "example",
"start_ip": "example",
"end_ip": "example",
"with_subdomains": true
}
OperationE
List of structures with information on counter actions.
|
Name |
Description |
|
action |
Type: string Action type:
Example: |
|
attr |
Type: string Field for filtering:
Example: |
|
status |
Type: string Action status:
Example: |
|
id |
Type: integer Action ID (needs to be specified while changing a counter action). |
|
value |
Type: string Value for replacement. Example: |
Example
{
"id": 0,
"action": "example",
"attr": "example",
"value": "example",
"status": "example"
}
CounterGrantE
List of structures with information on access rights to the counter.
|
Name |
Description |
|
perm |
Type: string Access level:
Example: |
|
comment |
Type: string Custom comment. The maximum number of characters is 255. Min length: Max length: Example: |
|
created_at |
Type: string<date-time> Date when the permission was granted in YYYY-MM-DD'T'hh:mm:ssZ format. Example: |
|
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 ( Example: |
Example
{
"user_login": "example",
"perm": "example",
"created_at": "2025-01-01T00:00:00Z",
"comment": "example",
"partner_data_access": true
}
AccessFiltersShortE
List of access filters granted to the user.
|
Name |
Description |
|
id |
Type: integer Access filter ID. |
|
name |
Type: string Access filter name. Example: |
Example
{
"id": 0,
"name": "example"
}
AccessFiltersGrantE
All of 2 types
-
Type: CounterGrantE
List of structures with information on access rights to the counter.
Example
{ "user_login": "example", "user_uid": 0, "perm": "example", "created_at": "2025-01-01T00:00:00Z", "comment": "example", "email": "example", "partner_data_access": true } -
Type: object
access_filters
Type: AccessFiltersShortE[]
Min items:
1Max items:
1Example
[ { "id": 0, "name": "example" } ]Example
{ "access_filters": [ { "id": 0, "name": "example" } ] }
Example
{
"user_login": "example",
"user_uid": 0,
"perm": "example",
"created_at": "2025-01-01T00:00:00Z",
"comment": "example",
"email": "example",
"partner_data_access": true,
"access_filters": [
{
"id": 0,
"name": "example"
}
]
}
Label
Label.
|
Name |
Description |
|
id |
Type: integer Label ID. |
|
name |
Type: string Label name. Min length: Max length: Example: |
Example
{
"id": 0,
"name": "example"
}
WebvisorOptions
Structure with information on Session Replay settings.
|
Name |
Description |
|
arch_enabled |
Type: boolean Saving site pages:
|
|
arch_type |
Type: string Recording page content:
Example: |
|
load_player_type |
Type: string Loading pages in the player:
Example: |
|
urls |
Type: string List of pages for saving. Min length: Max length: Example: |
|
wv_forms |
Type: boolean Records the content of fields and forms:
|
|
wv_version |
Type: integer Session Replay version. |
Example
{
"urls": "example",
"arch_enabled": true,
"arch_type": "example",
"load_player_type": "example",
"wv_version": 0,
"wv_forms": true
}
InformerOptionsE
Informer settings.
|
Name |
Description |
|
color_arrow |
Type: integer 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 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:
Example: |
|
size |
Type: integer Informer size:
Min value: Max value: |
|
type |
Type: string Informer type:
Example: |
Example
{
"enabled": true,
"type": "example",
"size": 1,
"indicator": "example",
"color_start": "FFFFFFFF.",
"color_end": "EFEFEFFF",
"color_text": 0,
"color_arrow": 0
}
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. Example
|
|
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:
|
Example
{
"async": true,
"informer": {
"enabled": true,
"type": "example",
"size": 1,
"indicator": "example",
"color_start": "FFFFFFFF.",
"color_end": "EFEFEFFF",
"color_text": 0,
"color_arrow": 0
},
"visor": true,
"track_hash": true,
"xml_site": true,
"clickmap": true,
"in_one_line": true,
"ecommerce": true,
"alternative_cdn": true
}
PublisherOptions
Structure with information on content analytics settings.
|
Name |
Description |
|
enabled |
Type: boolean Collection of content analytics data. To start collecting statistics, add the markup to your site.
|
|
schema |
Type: string Available site markup options. Possible values:
Example: |
|
schema_options |
Type: string[] Example
|
Example
{
"enabled": true,
"schema": "example",
"schema_options": [
"example"
]
}
CounterMirrorE
List of site mirrors (domains).
|
Name |
Description |
|
site |
Type: string Full site domain. Min length: Max length: Example: |
Example
{
"site": "example"
}
CounterCms
Tag CMS system. Possible values for the "code" field:
bitrix24: Bitrix24.flexbe: Flexbe.joomla: Joomla.drupal: Drupal.opencart: OpenCart.tilda: Tilda.webasyst: Webasyst.wix: Wix.wordpress: Wordpress.insales: Insales.nethouse: Nethouse. You can also pass a custom value using the "custom" field (up to 128 characters).
|
Name |
Description |
|
code |
Type: string Example: |
|
custom |
Type: string Min length: Max length: Example: |
Example
{
"code": "example",
"custom": "example"
}
CounterCrm
Tag CRM system. Possible values for the "code" field:
amocrm: AmoCRM.bitrix24: Bitrix24.megaplan: Megaplan.crm_1c: 1С:CRM.moysklad: Moy sklad.yclients: Yclients.retailcrm: RetailCRM. You can also pass a custom value using the "custom" field (up to 128 characters).
|
Name |
Description |
|
code |
Type: string Example: |
|
custom |
Type: string Min length: Max length: Example: |
Example
{
"code": "example",
"custom": "example"
}
SiteActivityProfile
Tag activity profile. Possible values for the "code" field:
retail: Online store.promo_site: Promo website.online_service: Cloud app.text_site: Informational website. You can also pass a custom value using the "custom" field (up to 1000 characters).
|
Name |
Description |
|
code |
Type: string Example: |
|
custom |
Type: string Min length: Max length: Example: |
Example
{
"code": "example",
"custom": "example"
}
CounterFlags
Data security and usage.
|
Name |
Description |
|
collect_first_party_data |
Type: boolean Use advanced tracking settings. Enabling this option will allow Yandex Metrica to use the contact information entered by users on the site to enhance advertising algorithms and more accurately analyze user behavior. This helps you get better results from your ad campaigns and learn more about user behavior, even if they use browsers that limit cross-site cookies (third-party cookies), such as Safari and Mozilla Firefox. |
|
direct_allow_use_goals_without_access |
Type: boolean Allow optimizing campaigns for goals without access to the counter. If someone other than you manages your Yandex Direct ad campaigns, such as an agency or a setup expert, you can grant them permission to use existing goals in Yandex Metrica. If the counter was created recently, the option is enabled by default. For more information, see Help. |
|
measurement_enabled |
Type: boolean Enable the Measurement Protocol option. The Measurement Protocol is an API for sending data about user interactions directly to Yandex Metrica servers via HTTP requests. |
|
use_in_benchmarks |
Type: boolean Get access to market reports. The option allows Yandex Metrica to use aggregated anonymized counter data to build market analytics reports. The collected data will provide you with insights into your business's performance within the market. If the counter was created recently, the option is enabled by default. |
Example
{
"use_in_benchmarks": true,
"direct_allow_use_goals_without_access": true,
"collect_first_party_data": true,
"measurement_enabled": true
}
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"
}
CounterFull
Counter.
|
Name |
Description |
|
activity_status |
Type: string Counter traffic. Possible values:
Example: |
|
autogoals_enabled |
Type: boolean Enabling automatic goals. Possible values:
|
|
cms |
Type: CounterCms Tag CMS system. Possible values for the "code" field:
Example
|
|
code |
Type: string HTML ad tag. Example: |
|
code_options |
Type: CodeOptionsE Counter code settings. Example
|
|
counter_flags |
Type: CounterFlags Data security and usage. Example
|
|
create_time |
Type: string<date-time> Date and time when the counter was created. Example: |
|
crm |
Type: CounterCrm Tag CRM system. Possible values for the "code" field:
Example
|
|
delete_time |
Type: string Time of counter deletion. Example: |
|
favorite |
Type: boolean Whether the counter is added to favorites:
|
|
filter_robots |
Type: integer Filtering of robots:
Min value: Max value: |
|
filters |
Type: FilterE[] Example
|
|
gdpr_agreement_accepted |
Type: boolean Acceptance of the Yandex Metrica Data Processing Agreement.
|
|
goals |
Type: arrayOne of 13 types
List of structures with information on counter goals. Example
|
|
grants |
Type: arrayOne of 2 types
Example
|
|
id |
Type: integer Counter ID. |
|
labels |
Type: Label[] List of structures with information on labels. Example
|
|
measurement_tokens |
Type: string[] Example
|
|
mirrors2 |
Type: CounterMirrorE[] Example
|
|
name |
Type: string Counter name. Min length: Max length: Example: |
|
operations |
Type: OperationE[] Example
|
|
owner_login |
Type: string Login of the counter owner. Example: |
|
permission |
Type: string Level of access to the counter:
Example: |
|
publisher_options |
Type: PublisherOptions Structure with information on content analytics settings. Example
|
|
site_activity |
Type: SiteActivityProfile Tag activity profile. Possible values for the "code" field:
Example
|
|
site2 |
Type: CounterMirrorE List of site mirrors (domains). Example
|
|
status |
Type: string Counter status. Possible values:
Example: |
|
time_zone_name |
Type: string Time zone for calculating statistics. Example: |
|
time_zone_offset |
Type: integer Current time zone offset from GMT (minutes). |
|
type |
Type: string Counter type. Possible values:
Example: |
|
update_time |
Type: string Time of the last counter update. Example: |
|
vendor_id |
Type: integer |
|
visit_threshold |
Type: integer Session timeout in seconds. Default: Min value: Max value: |
|
webvisor |
Type: WebvisorOptions Structure with information on Session Replay settings. Example
|
Example
{
"id": 0,
"status": "example",
"owner_login": "example",
"activity_status": "example",
"name": "example",
"type": "example",
"favorite": true,
"permission": "example",
"goals": [
{
"id": 0,
"name": "example",
"type": "example",
"default_price": 0.5,
"is_retargeting": true,
"is_favorite": true,
"status": "example",
"conditions": [
null
],
"prev_goal_id": 0,
"flag": "example"
}
],
"filters": [
{
"id": 0,
"attr": "example",
"type": "example",
"value": "example",
"action": "example",
"status": "example",
"start_ip": "example",
"end_ip": "example",
"with_subdomains": true
}
],
"operations": [
{
"id": 0,
"action": "example",
"attr": "example",
"value": "example",
"status": "example"
}
],
"grants": [
{
"user_login": "example",
"user_uid": 0,
"perm": "example",
"created_at": "2025-01-01T00:00:00Z",
"comment": "example",
"email": "example",
"partner_data_access": true
}
],
"labels": [
{
"id": 0,
"name": "example"
}
],
"webvisor": {
"urls": "example",
"arch_enabled": true,
"arch_type": "example",
"load_player_type": "example",
"wv_version": 0,
"wv_forms": true
},
"code_options": {
"async": true,
"informer": {
"enabled": true,
"type": "example",
"size": 1,
"indicator": "example",
"color_start": "FFFFFFFF.",
"color_end": "EFEFEFFF",
"color_text": 0,
"color_arrow": 0
},
"visor": true,
"track_hash": true,
"xml_site": true,
"clickmap": true,
"in_one_line": true,
"ecommerce": true,
"alternative_cdn": true,
"ecommerce_object": "example",
"ssr": true
},
"create_time": "2025-01-01T00:00:00Z",
"time_zone_name": "example",
"time_zone_offset": 0,
"update_time": "example",
"delete_time": "example",
"code": "example",
"filter_robots": 1,
"visit_threshold": 1800,
"publisher_options": {
"enabled": true,
"schema": "example",
"schema_options": [
"example"
]
},
"vendor_id": 0,
"site2": {
"site": "example",
"domain": "example",
"status": "example"
},
"gdpr_agreement_accepted": true,
"mirrors2": [
null
],
"cms": {
"code": "example",
"custom": "example"
},
"crm": {
"code": "example",
"custom": "example"
},
"site_activity": {
"code": "example",
"custom": "example"
},
"autogoals_enabled": true,
"counter_flags": {
"counter_id": 0,
"use_in_benchmarks": true,
"direct_allow_use_goals_without_access": true,
"incognito": "example",
"collect_first_party_data": true,
"collect_masked_first_party_data": true,
"statistics_over_site": true,
"measurement_enabled": true,
"vendor_data": true,
"allow_use_data_to_collect_feedback": true
},
"measurement_tokens": [
"example"
]
}
CommunicationChannel
Tag communication channels. Possible values for the "code" field:
messengers: Messengers.call_track: Call tracking.direct_call: Direct calls. You can also pass a custom value using the "custom" field (up to 1000 characters).
|
Name |
Description |
|
code |
Type: string Example: |
|
custom |
Type: string Min length: Max length: Example: |
Example
{
"code": "example",
"custom": "example"
}
CounterIndustry
Tag industries. Possible values for the "code" field:
finance_and_insurance: Finance and insurance.real_estate: Real estate.construction: Construction and repair.house_and_garden: Home and garden.domestic_services: Personal services and food service.electronics: Electronics.healthcare: Medicine.appliances: Household appliances.gastronomy: Cooking and recipes.auto_and_moto: Auto and moto.engineering_and_technologies: Tech.it_and_telecom: IT and telecom.clothes: Clothing and footwear.health_and_beauty: Health and beauty.sport: Sports and active lifestyle.jobs_and_career: Work and career.education: Education.family_and_kids: Family and children.pets: Pets.travel: Travel and tourism.entertainment: Entertainment, leisure, 18+.social_networks: Communication (social media, messengers).gifts: Gifts.business_and_consulting: Business and consulting.advertisement: Advertising and marketing.online_services: Online services.industry: Industry and agriculture.transportation: Transportation.legal_services: Legal services and consulting.government_and_society: State and society.knowledge_sources: Reference resources.news: News and media.culture_and_art: Culture and art.religion: Religion.science: Science.unexplored: Unknown. You can also pass a custom value using the "custom" field (up to 1000 characters).
|
Name |
Description |
|
code |
Type: string Example: |
|
custom |
Type: string Min length: Max length: Example: |
Example
{
"code": "example",
"custom": "example"
}
UserActivityProfile
User activity profiles in the tag. Possible values:
business: Business management.traffic: Marketing and advertising.conversions: Sales and conversions.product_management: Product management.marketing: Content marketing.design: User interface design.development: Development and support.analytics: Analytics. You can also pass a custom value using the "custom" field (up to 1000 characters).
|
Name |
Description |
|
code |
Type: string Example: |
|
custom |
Type: string Min length: Max length: Example: |
Example
{
"code": "example",
"custom": "example"
}
Responses
200 OK
OK
Body
application/json
{
"counter": {
"id": 0,
"status": "example",
"owner_login": "example",
"activity_status": "example",
"name": "example",
"type": "example",
"favorite": true,
"hide_address": true,
"pro": true,
"pro_features": [
"example"
],
"permission": "example",
"goals": [
null
],
"filters": [
{
"id": 0,
"attr": "example",
"type": "example",
"value": "example",
"action": "example",
"status": "example",
"start_ip": "example",
"end_ip": "example",
"with_subdomains": true
}
],
"operations": [
{
"id": 0,
"action": "example",
"attr": "example",
"value": "example",
"status": "example"
}
],
"grants": [
{
"user_login": "example",
"user_uid": 0,
"perm": "example",
"created_at": "2025-01-01T00:00:00Z",
"comment": "example",
"email": "example",
"partner_data_access": true
}
],
"labels": [
{
"id": 0,
"name": "example"
}
],
"webvisor": {
"urls": "example",
"arch_enabled": true,
"arch_type": "example",
"load_player_type": "example",
"wv_version": 0,
"allow_wv2": true,
"notify_wv2": true,
"wv_forms": true
},
"code_options": {
"async": true,
"informer": {
"enabled": true,
"type": "example",
"size": 1,
"indicator": "example",
"color_start": "FFFFFFFF.",
"color_end": "EFEFEFFF",
"color_text": 0,
"color_arrow": 0
},
"visor": true,
"track_hash": true,
"xml_site": true,
"clickmap": true,
"in_one_line": true,
"ecommerce": true,
"alternative_cdn": true,
"ecommerce_object": "example",
"ytm": true,
"ssr": true
},
"create_time": "2025-01-01T00:00:00Z",
"time_zone_name": "example",
"time_zone_offset": 0,
"partner_id": 0,
"title": "example",
"grants_cnt": 0,
"source": "example",
"update_time": "example",
"delete_time": "example",
"code": "example",
"filter_robots": 1,
"currency": 0,
"currency_code": "example",
"visit_threshold": 1800,
"max_goals": 0,
"max_operations": 0,
"max_filters": 0,
"features": [
"example"
],
"publisher_options": {
"enabled": true,
"schema": "example",
"schema_options": [
"example"
]
},
"total_geo_points_count": 0,
"selected_geo_points_count": 0,
"vendor_id": 0,
"site2": {
"site": "example",
"domain": "example",
"status": "example"
},
"gdpr_agreement_accepted": true,
"delete_guest_allowed": true,
"mirrors2": [
null
],
"cms": {
"code": "example",
"custom": "example"
},
"crm": {
"code": "example",
"custom": "example"
},
"communication_channel": [
{
"code": "example",
"custom": "example"
}
],
"industry": [
{
"code": "example",
"custom": "example"
}
],
"site_activity": {
"code": "example",
"custom": "example"
},
"user_activity": [
{
"code": "example",
"custom": "example"
}
],
"autogoals_enabled": true,
"ecommerce_deduplicator_enabled": true,
"counter_flags": {
"counter_id": 0,
"use_in_benchmarks": true,
"direct_allow_use_goals_without_access": true,
"incognito": "example",
"collect_first_party_data": true,
"collect_masked_first_party_data": true,
"statistics_over_site": true,
"measurement_enabled": true,
"vendor_data": true,
"allow_use_data_to_collect_feedback": true
},
"measurement_tokens": [
"example"
]
}
}
|
Name |
Description |
|
counter |
Type: CounterFull Counter. 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"
}
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"
}
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
}
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. Example
|
|
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:
|
Example
{
"async": true,
"informer": {
"enabled": true,
"type": "example",
"size": 1,
"indicator": "example",
"color_start": "FFFFFFFF.",
"color_end": "EFEFEFFF",
"color_text": 0,
"color_arrow": 0
},
"visor": true,
"track_hash": true,
"xml_site": true,
"clickmap": true,
"in_one_line": true,
"ecommerce": true,
"alternative_cdn": true,
"ytm": true
}
CounterFull
Counter.
|
Name |
Description |
|
activity_status |
Type: string Counter traffic. Possible values:
Example: |
|
autogoals_enabled |
Type: boolean Enabling automatic goals. Possible values:
|
|
cms |
Type: CounterCms Tag CMS system. Possible values for the "code" field:
Example
|
|
code |
Type: string HTML ad tag. Example: |
|
code_options |
Type: CodeOptionsE Counter code settings. Example
|
|
counter_flags |
Type: CounterFlags Data security and usage. Example
|
|
create_time |
Type: string<date-time> Date and time when the counter was created. Example: |
|
crm |
Type: CounterCrm Tag CRM system. Possible values for the "code" field:
Example
|
|
delete_time |
Type: string Time of counter deletion. Example: |
|
favorite |
Type: boolean Whether the counter is added to favorites:
|
|
filter_robots |
Type: integer Filtering of robots:
Min value: Max value: |
|
filters |
Type: FilterE[] Example
|
|
gdpr_agreement_accepted |
Type: boolean Acceptance of the Yandex Metrica Data Processing Agreement.
|
|
goals |
Type: arrayOne of 13 types
List of structures with information on counter goals. Example
|
|
grants |
Type: arrayOne of 2 types
Example
|
|
id |
Type: integer Counter ID. |
|
labels |
Type: Label[] List of structures with information on labels. Example
|
|
measurement_tokens |
Type: string[] Example
|
|
mirrors2 |
Type: CounterMirrorE[] Example
|
|
name |
Type: string Counter name. Min length: Max length: Example: |
|
operations |
Type: OperationE[] Example
|
|
owner_login |
Type: string Login of the counter owner. Example: |
|
permission |
Type: string Level of access to the counter:
Example: |
|
publisher_options |
Type: PublisherOptions Structure with information on content analytics settings. Example
|
|
site_activity |
Type: SiteActivityProfile Tag activity profile. Possible values for the "code" field:
Example
|
|
site2 |
Type: CounterMirrorE List of site mirrors (domains). Example
|
|
source |
Type: string Counter type. Possible values:
Example: |
|
status |
Type: string Counter status. Possible values:
Example: |
|
time_zone_name |
Type: string Time zone for calculating statistics. Example: |
|
time_zone_offset |
Type: integer Current time zone offset from GMT (minutes). |
|
type |
Type: string Counter type. Possible values:
Example: |
|
update_time |
Type: string Time of the last counter update. Example: |
|
vendor_id |
Type: integer |
|
visit_threshold |
Type: integer Session timeout in seconds. Default: Min value: Max value: |
|
webvisor |
Type: WebvisorOptions Structure with information on Session Replay settings. Example
|
Example
{
"id": 0,
"status": "example",
"owner_login": "example",
"activity_status": "example",
"name": "example",
"type": "example",
"favorite": true,
"permission": "example",
"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"
}
],
"filters": [
{
"id": 0,
"attr": "example",
"type": "example",
"value": "example",
"action": "example",
"status": "example",
"start_ip": "example",
"end_ip": "example",
"with_subdomains": true
}
],
"operations": [
{
"id": 0,
"action": "example",
"attr": "example",
"value": "example",
"status": "example"
}
],
"grants": [
{
"user_login": "example",
"user_uid": 0,
"perm": "example",
"created_at": "2025-01-01T00:00:00Z",
"comment": "example",
"email": "example",
"partner_data_access": true
}
],
"labels": [
{
"id": 0,
"name": "example"
}
],
"webvisor": {
"urls": "example",
"arch_enabled": true,
"arch_type": "example",
"load_player_type": "example",
"wv_version": 0,
"allow_wv2": true,
"notify_wv2": true,
"wv_forms": true
},
"code_options": {
"async": true,
"informer": {
"enabled": true,
"type": "example",
"size": 1,
"indicator": "example",
"color_start": "FFFFFFFF.",
"color_end": "EFEFEFFF",
"color_text": 0,
"color_arrow": 0
},
"visor": true,
"track_hash": true,
"xml_site": true,
"clickmap": true,
"in_one_line": true,
"ecommerce": true,
"alternative_cdn": true,
"ecommerce_object": "example",
"ytm": true,
"ssr": true
},
"create_time": "2025-01-01T00:00:00Z",
"time_zone_name": "example",
"time_zone_offset": 0,
"source": "example",
"update_time": "example",
"delete_time": "example",
"code": "example",
"filter_robots": 1,
"visit_threshold": 1800,
"publisher_options": {
"enabled": true,
"schema": "example",
"schema_options": [
"example"
]
},
"vendor_id": 0,
"site2": {
"site": "example",
"domain": "example",
"status": "example"
},
"gdpr_agreement_accepted": true,
"mirrors2": [
null
],
"cms": {
"code": "example",
"custom": "example"
},
"crm": {
"code": "example",
"custom": "example"
},
"site_activity": {
"code": "example",
"custom": "example"
},
"autogoals_enabled": true,
"counter_flags": {
"counter_id": 0,
"use_in_benchmarks": true,
"direct_allow_use_goals_without_access": true,
"incognito": "example",
"collect_first_party_data": true,
"collect_masked_first_party_data": true,
"statistics_over_site": true,
"measurement_enabled": true,
"vendor_data": true,
"allow_use_data_to_collect_feedback": true
},
"measurement_tokens": [
"example"
]
}
No longer supported, please use an alternative and newer version.