List of available tags

Returns a list of existing tags available to the user.

  1. Request syntax
  2. Response format

Request syntax

https://api-metrika.yandex.net/management/v1/counters
 ? [callback=<string>]
 & [counter_ids=<list>]
 & [favorite=<boolean>]
 & [field=<string>]
 & [label_id=<integer>]
 & [offset=<int>]
 & [per_page=<int>]
 & [permission=<string>]
 & [reverse=<boolean>]
 & [robots=<boolean>]
 & [search_string=<string>]
 & [sort=<counters_sort>]
 & [status=<counter_status>]
 & [type=<counter_type>]
callbackCallback function that processes the API response.
counter_idsList of IDs of tags you want to get.
favoriteFilter by tags that were added to Favorites.

Default value: 0

field

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. For example: field=goals,mirrors,grants,filters,operations.

label_idFilter by tag.
offsetSerial number of the tag to start the list of tags. The first tag has the number 1.

Default value: 1

per_pageNumber of tags that you want to receive.

Default value: 1000

permission

Filter by level of access to the tag. Parameter can contain several values, separated by commas.

Acceptable values:

  • own: Tag that belongs to the user.
  • view: Tag with guest access level (“view only”).
  • edit: Guest tag with “full access”.
reverseDisplay tags in ascending or descending order.

Default value: true

robotsWhether to include robot sessions

The default value is true.

search_string
Filter by string. You can specify:
  • Tag ID.
  • Tag name.
  • Address of the site where the tag is installed.
  • Additional address.

The response will include tags that have the specified substring in their name, site, or mirrors.

When filtering by ID, specify the full ID.

sortSorting.

Default value: Default

Acceptable values:

  • None: No sorting
  • Default: Default sorting
  • Visits: Number of sessions
  • Hits: Number of hits
  • Uniques: Number of users
  • Name: Tag name
statusFilter by tag status. Enabled by default.

Default value: Active

Acceptable values:

  • Active: Tag active.
  • Deleted: Tag deleted.
typeFilter by tag type.

Acceptable values:

  • simple: Tag created by the user in Yandex Metrica.
  • partner: Tag imported from YAN.
callbackCallback function that processes the API response.
counter_idsList of IDs of tags you want to get.
favoriteFilter by tags that were added to Favorites.

Default value: 0

field

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. For example: field=goals,mirrors,grants,filters,operations.

label_idFilter by tag.
offsetSerial number of the tag to start the list of tags. The first tag has the number 1.

Default value: 1

per_pageNumber of tags that you want to receive.

Default value: 1000

permission

Filter by level of access to the tag. Parameter can contain several values, separated by commas.

Acceptable values:

  • own: Tag that belongs to the user.
  • view: Tag with guest access level (“view only”).
  • edit: Guest tag with “full access”.
reverseDisplay tags in ascending or descending order.

Default value: true

robotsWhether to include robot sessions

The default value is true.

search_string
Filter by string. You can specify:
  • Tag ID.
  • Tag name.
  • Address of the site where the tag is installed.
  • Additional address.

The response will include tags that have the specified substring in their name, site, or mirrors.

When filtering by ID, specify the full ID.

sortSorting.

Default value: Default

Acceptable values:

  • None: No sorting
  • Default: Default sorting
  • Visits: Number of sessions
  • Hits: Number of hits
  • Uniques: Number of users
  • Name: Tag name
statusFilter by tag status. Enabled by default.

Default value: Active

Acceptable values:

  • Active: Tag active.
  • Deleted: Tag deleted.
typeFilter by tag type.

Acceptable values:

  • simple: Tag created by the user in Yandex Metrica.
  • partner: Tag imported from YAN.

Response format


{
    "rows" :  < int > ,
    "counters" : [ {
        "id" :  < int > ,
        "status" :  < counter_status > ,
        "owner_login" :  < string > ,
        "code_status" :  < string > ,
        "activity_status" :  < counter_activity_status > ,
        "name" :  < string > ,
        "site2" : {
            "site" :  < string > 
        },
        "type" :  < counter_type > ,
        "favorite" :  < boolean > ,
        "gdpr_agreement_accepted" :  < boolean > ,
        "permission" :  < counter_permission > ,
        "mirrors2" : [ {
            "site" :  < string > 
        }, ... ],
        "goals" : [  < goal > , ... ],
        "filters" : [ {
            "id" :  < int > ,
            "attr" :  < filter_attribute > ,
            "type" :  < filter_type > ,
            "value" :  < string > ,
            "action" :  < filter_action > ,
            "status" :  < filter_status > ,
            "start_ip" :  < string > ,
            "end_ip" :  < string > ,
            "with_subdomains" :  < boolean > 
        }, ... ],
        "operations" : [ {
            "id" :  < int > ,
            "action" :  < operation_type > ,
            "attr" :  < operation_attribute > ,
            "value" :  < string > ,
            "status" :  < operation_status > 
        }, ... ],
        "grants" : [ {
            "user_login" :  < string > ,
            "user_uid" :  < long > ,
            "perm" :  < grant_type > ,
            "created_at" :  < date > ,
            "comment" :  < string > ,
            "partner_data_access" :  < boolean > 
        }, ... ],
        "labels" : [ {
            "id" :  < int > ,
            "name" :  < string > 
        }, ... ],
        "webvisor" : {
            "urls" :  < string > ,
            "arch_enabled" :  < boolean > ,
            "arch_type" :  < webvisor_arch_type > ,
            "load_player_type" :  < webvisor_load_player_type > ,
            "wv_version" :  < integer > ,
            "wv_forms" :  < boolean > 
        },
        "code_options" : {
            "async" :  < boolean > ,
            "informer" : {
                "enabled" :  < boolean > ,
                "type" :  < informer_type > ,
                "size" :  < integer > ,
                "indicator" :  < informer_metric > ,
                "color_start" :  < string > ,
                "color_end" :  < string > ,
                "color_text" :  < integer > ,
                "color_arrow" :  < integer > 
            },
            "visor" :  < boolean > ,
            "track_hash" :  < boolean > ,
            "xml_site" :  < boolean > ,
            "clickmap" :  < boolean > ,
            "in_one_line" :  < boolean > ,
            "ecommerce" :  < boolean > ,
            "alternative_cdn" :  < boolean > 
        },
        "create_time" :  < date > ,
        "time_zone_name" :  < string > ,
        "time_zone_offset" :  < int > ,
        "source" :  < counter_source > 
    }, ... ]
}
Parameters Description
rows Number of tags that match the request, excluding the offset and per_page parameters.
counters List of tags.
counters
id Tag ID.
status Tag status.

Possible values:

  • Active: Tag active.
  • Deleted: Tag deleted.
owner_login Login of the tag owner.
code_status Code snippet installation status.
Attention. The parameter is deprecated, don't use it when working with data. The value returned is always CS_ERR_UNKNOWN (unknown error). In the future, code_status will be deleted.
activity_status Tag traffic.
name Tag name.
site2 Full site domain.
type Counter type.

Possible values:

  • simple: Tag created by the user in Yandex Metrica.
  • partner: Tag imported from YAN.
favorite Whether the tag is added to favorites.

Possible values:

  • 0: Not added (default).
  • 1: Added.
gdpr_agreement_accepted Acceptance of the “Yandex Metrica” Data Processing Agreement.

Possible values:

  • 0: Agreement not accepted (default).
  • 1: Agreement accepted.
permission Level of access to the tag.

Possible values:

  • own: Tag that belongs to the user.
  • view: Tag with guest access level (“view only”).
  • edit: Guest tag with “full access”.
mirrors2 List of site mirrors (domains).
goals List of structures with information on tag goals.
filters List of structures with information on tag filters.
operations List of structures with information on tag actions.
grants List of structures with information on access rights to the tag.
labels List of structures with information on tags.
session replay Structure with information on Session Replay settings.
code_options Code snippet settings.
create_time Date and time when the tag was created.
time_zone_name Time zone for calculating statistics.
time_zone_offset Current time zone offset from Greenwich, minutes.
source Tag type.
site2
site Full site domain.
mirrors2
site Full site domain.
filters
id

Filter ID. Specify this parameter when changing a tag filter

attr Type of data to apply the filter to.

Possible values:

  • title: Page title.
  • client_ip: IP address.
  • url: Page URL.
  • referer: Referrer.
  • uniq_id: Special filter attribute “Don't count my sessions”.
type Filter type or action for filter.

Possible values:

  • equal: Equal to.
  • start: Starts with.
  • contain: Contains.
  • interval: In the interval, used only with the data type “Ipad dress” (attr = client_ip).
  • me: My visits, used only with the data type attr = uniq_id.
  • only_mirrors: Only site and mirrors, used only for the data type “page URL” (attr = url) and the filter type “only record traffic” (action = include), as well as when mirrors are specified for the tag.
  • regexp: Regular expression.
value Filter value.
action Filter type.

Possible values:

  • exclude: Exclude traffic.
  • include: Keep traffic only.
status Filter status.

Possible values:

  • active: Filter is used.
  • disabled: Filter disabled (without deletion).
start_ip First IP address in the range.
end_ip Last IP address in the range.
with_subdomains Filter by subdomains.
operations
id

Action ID (needs to be specified while changing a tag action).

action Action type.

Possible values:

  • cut_fragment: Remove anchor from URL.
  • cut_parameter: Remove specific parameter from URL.
  • cut_all_parameters: Cut all parameters from URL.
  • merge_https_and_http: Replace https:// with http://.
  • to_lower: Convert to lower case.
  • replace_domain: Replace domain.
attr Field for filtering.

Possible values:

  • referer: Referrer.
  • url: Page URL.
value Value for replacement.
status Action status.

Possible values:

  • active: Action is used.
  • disabled: Action is disabled (without deletion).
grants
user_login

Login of a user with tag management rights.

This parameter contains an empty string if tag statistics are in public access (perm = public_stat)

user_uid

uid of a user with tag management rights.

Parameter is 0 if tag statistics are in public access (perm = public_stat)

perm Permission level.

Possible values:

  • public_stat: Public access to statistics.
  • view: Read only.
  • edit: Full access.
created_at

Date when the permission was granted in YYYY-MM-DD'T'hh:mm:ssZ format.

comment

Arbitrary comment. The maximum number of characters is 255.

partner_data_access

Access to the Monetization report group. The user can view reports and add dimensions and metrics from the Monetization group to other reports.

If the user has edit rights, reports from the Monetization group are already available to them.

Possible values:

  • true: Access granted.
  • false: Access denied.
labels
id Label ID.
name Label name.
webvisor
urls List of pages for saving.
arch_enabled Saving site pages.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
arch_type Recording page content.

Possible values:

  • none: Disabled.
  • load: Download from site.
  • html: From browser.
load_player_type Loading pages in the player.

Possible values:

  • proxy: As an anonymous user.
  • on_your_behalf: As you.
wv_version Session Replay version.
wv_forms Records the content of fields and forms.

Possible values:

  • 0: Don't record the content of fields and forms, except the ones marked with the -metrika-recordkeys CSS class.
  • 1: Record the content of fields and forms, except the ones marked with the -metrika-nokeys CSS class (default).
code_options
async Asynchronous code snippet.

Possible values:

  • 0: Disabled.
  • 1: Enabled (default).
informer Informer settings.
visor Record and analysis of site user behavior.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
track_hash Hash tracking in the browser address bar. The option applies to AJAX sites.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
xml_site For XML sites. The "noscript" element cannot be used in XML documents.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
clickmap Gathering statistics for the Click Map report.

Possible values:

  • 0: Disabled.
  • 1: Enabled (default)
in_one_line Print code snippet as a single string.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
ecommerce Collecting E-commerce data.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
alternative_cdn Allows you to correctly register sessions from regions in which access to Yandex resources is restricted. It might take longer to load the tag code when using this option.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
informer
enabled Permission to display the informer.

Possible values:

  • 0: Informer is not displayed (default).
  • 1: Informer is displayed.
type Informer type.

Possible values:

  • simple: Simple.
  • ext: Extended (default).
size Informer size.

Possible values:

  • 1: 80×15
  • 2: 80х31
  • 3: 88×31 (default) The value in the "indicator" field doesn't affect the layout of this type of informer.
indicator Parameter to be displayed on the informer.

Possible values:

  • pageviews: Pageviews (default).
  • visits: Sessions.
  • uniques: Users.
color_start Beginning (top) color of the informer in RRGGBBAA format. RR, GG, BB are saturated red, green, and blue colors. The level of saturation for every color is set with a value ranging from 00 to FF. AA is transparency from 00 (transparent) to FF (opaque).
color_end Ending (bottom) color of the informer in RRGGBBAA format. The parameter is intended for creating background gradient. Color saturation and transparency are set the same way as with the "color_start" parameter.
color_text Color of the text in the informer.

Possible values:

  • 0: Black (default).
  • 1: White.
color_arrow Color of the arrow in the informer.

Possible values:

  • 0: Black.
  • 1: Purple (default).
Parameters Description
rows Number of tags that match the request, excluding the offset and per_page parameters.
counters List of tags.
counters
id Tag ID.
status Tag status.

Possible values:

  • Active: Tag active.
  • Deleted: Tag deleted.
owner_login Login of the tag owner.
code_status Code snippet installation status.
Attention. The parameter is deprecated, don't use it when working with data. The value returned is always CS_ERR_UNKNOWN (unknown error). In the future, code_status will be deleted.
activity_status Tag traffic.
name Tag name.
site2 Full site domain.
type Counter type.

Possible values:

  • simple: Tag created by the user in Yandex Metrica.
  • partner: Tag imported from YAN.
favorite Whether the tag is added to favorites.

Possible values:

  • 0: Not added (default).
  • 1: Added.
gdpr_agreement_accepted Acceptance of the “Yandex Metrica” Data Processing Agreement.

Possible values:

  • 0: Agreement not accepted (default).
  • 1: Agreement accepted.
permission Level of access to the tag.

Possible values:

  • own: Tag that belongs to the user.
  • view: Tag with guest access level (“view only”).
  • edit: Guest tag with “full access”.
mirrors2 List of site mirrors (domains).
goals List of structures with information on tag goals.
filters List of structures with information on tag filters.
operations List of structures with information on tag actions.
grants List of structures with information on access rights to the tag.
labels List of structures with information on tags.
session replay Structure with information on Session Replay settings.
code_options Code snippet settings.
create_time Date and time when the tag was created.
time_zone_name Time zone for calculating statistics.
time_zone_offset Current time zone offset from Greenwich, minutes.
source Tag type.
site2
site Full site domain.
mirrors2
site Full site domain.
filters
id

Filter ID. Specify this parameter when changing a tag filter

attr Type of data to apply the filter to.

Possible values:

  • title: Page title.
  • client_ip: IP address.
  • url: Page URL.
  • referer: Referrer.
  • uniq_id: Special filter attribute “Don't count my sessions”.
type Filter type or action for filter.

Possible values:

  • equal: Equal to.
  • start: Starts with.
  • contain: Contains.
  • interval: In the interval, used only with the data type “Ipad dress” (attr = client_ip).
  • me: My visits, used only with the data type attr = uniq_id.
  • only_mirrors: Only site and mirrors, used only for the data type “page URL” (attr = url) and the filter type “only record traffic” (action = include), as well as when mirrors are specified for the tag.
  • regexp: Regular expression.
value Filter value.
action Filter type.

Possible values:

  • exclude: Exclude traffic.
  • include: Keep traffic only.
status Filter status.

Possible values:

  • active: Filter is used.
  • disabled: Filter disabled (without deletion).
start_ip First IP address in the range.
end_ip Last IP address in the range.
with_subdomains Filter by subdomains.
operations
id

Action ID (needs to be specified while changing a tag action).

action Action type.

Possible values:

  • cut_fragment: Remove anchor from URL.
  • cut_parameter: Remove specific parameter from URL.
  • cut_all_parameters: Cut all parameters from URL.
  • merge_https_and_http: Replace https:// with http://.
  • to_lower: Convert to lower case.
  • replace_domain: Replace domain.
attr Field for filtering.

Possible values:

  • referer: Referrer.
  • url: Page URL.
value Value for replacement.
status Action status.

Possible values:

  • active: Action is used.
  • disabled: Action is disabled (without deletion).
grants
user_login

Login of a user with tag management rights.

This parameter contains an empty string if tag statistics are in public access (perm = public_stat)

user_uid

uid of a user with tag management rights.

Parameter is 0 if tag statistics are in public access (perm = public_stat)

perm Permission level.

Possible values:

  • public_stat: Public access to statistics.
  • view: Read only.
  • edit: Full access.
created_at

Date when the permission was granted in YYYY-MM-DD'T'hh:mm:ssZ format.

comment

Arbitrary comment. The maximum number of characters is 255.

partner_data_access

Access to the Monetization report group. The user can view reports and add dimensions and metrics from the Monetization group to other reports.

If the user has edit rights, reports from the Monetization group are already available to them.

Possible values:

  • true: Access granted.
  • false: Access denied.
labels
id Label ID.
name Label name.
webvisor
urls List of pages for saving.
arch_enabled Saving site pages.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
arch_type Recording page content.

Possible values:

  • none: Disabled.
  • load: Download from site.
  • html: From browser.
load_player_type Loading pages in the player.

Possible values:

  • proxy: As an anonymous user.
  • on_your_behalf: As you.
wv_version Session Replay version.
wv_forms Records the content of fields and forms.

Possible values:

  • 0: Don't record the content of fields and forms, except the ones marked with the -metrika-recordkeys CSS class.
  • 1: Record the content of fields and forms, except the ones marked with the -metrika-nokeys CSS class (default).
code_options
async Asynchronous code snippet.

Possible values:

  • 0: Disabled.
  • 1: Enabled (default).
informer Informer settings.
visor Record and analysis of site user behavior.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
track_hash Hash tracking in the browser address bar. The option applies to AJAX sites.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
xml_site For XML sites. The "noscript" element cannot be used in XML documents.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
clickmap Gathering statistics for the Click Map report.

Possible values:

  • 0: Disabled.
  • 1: Enabled (default)
in_one_line Print code snippet as a single string.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
ecommerce Collecting E-commerce data.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
alternative_cdn Allows you to correctly register sessions from regions in which access to Yandex resources is restricted. It might take longer to load the tag code when using this option.

Possible values:

  • 0: Disabled (default).
  • 1: Enabled.
informer
enabled Permission to display the informer.

Possible values:

  • 0: Informer is not displayed (default).
  • 1: Informer is displayed.
type Informer type.

Possible values:

  • simple: Simple.
  • ext: Extended (default).
size Informer size.

Possible values:

  • 1: 80×15
  • 2: 80х31
  • 3: 88×31 (default) The value in the "indicator" field doesn't affect the layout of this type of informer.
indicator Parameter to be displayed on the informer.

Possible values:

  • pageviews: Pageviews (default).
  • visits: Sessions.
  • uniques: Users.
color_start Beginning (top) color of the informer in RRGGBBAA format. RR, GG, BB are saturated red, green, and blue colors. The level of saturation for every color is set with a value ranging from 00 to FF. AA is transparency from 00 (transparent) to FF (opaque).
color_end Ending (bottom) color of the informer in RRGGBBAA format. The parameter is intended for creating background gradient. Color saturation and transparency are set the same way as with the "color_start" parameter.
color_text Color of the text in the informer.

Possible values:

  • 0: Black (default).
  • 1: White.
color_arrow Color of the arrow in the informer.

Possible values:

  • 0: Black.
  • 1: Purple (default).