Information on counter

Returns information about specified counter.

  1. Request syntax
  2. Response format

Request syntax

counterId — counter ID, the information of which you want to get.

https://api-metrica.yandex.net/management/v1/counter/{counterId}
 ? [callback=<string>]
 & [field=<string>]
Query parameters
callbackCallback function which returns an API response.
fieldOne 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,operation.

Response format


{
    "counter" : {
        "id" :  < int > ,
        "status" :  < counter_status > ,
        "owner_login" :  < string > ,
        "code_status" :  < code_status > ,
        "code_status_info" : {
            "length" :  < integer > ,
            "found" :  < integer > ,
            "match" :  < integer > ,
            "http_code" :  < integer > ,
            "http_msg" :  < string > ,
            "duration" :  < double > ,
            "infected" :  < string > 
        },
        "name" :  < string > ,
        "site2" : {
            "site" :  < string > 
        },
        "type" :  < counter_type > ,
        "favorite" :  < 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 > ,
            "perm" :  < grant_type > ,
            "created_at" :  < date > ,
            "comment" :  < string > 
        }, ... ],
        "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 > 
        },
        "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 > ,
            "ut" :  < boolean > ,
            "track_hash" :  < boolean > ,
            "xml_site" :  < boolean > ,
            "clickmap" :  < boolean > ,
            "in_one_line" :  < boolean > ,
            "ecommerce" :  < boolean > 
        },
        "create_time" :  < date > ,
        "time_zone_name" :  < string > ,
        "time_zone_offset" :  < int > ,
        "update_time" :  < string > ,
        "code" :  < string > ,
        "monitoring" : {
            "enable_monitoring" :  < int > ,
            "emails" : [  < string > , ... ],
            "sms_allowed" :  < int > ,
            "enable_sms" :  < int > ,
            "sms_time" :  < string > ,
            "phones" : [  < string > , ... ]
        },
        "filter_robots" :  < integer > ,
        "visit_threshold" :  < integer > ,
        "offline_options" : {
            "offline_conversion_extended_threshold" :  < boolean > ,
            "offline_calls_extended_threshold" :  < boolean > ,
            "offline_visits_extended_threshold" :  < boolean > 
        }
    }
}
Parameters Description
counter Counter.
counter
id Counter ID.
status Counter status.

Possible values:

  • Active — Counter active
  • Deleted — Counter deleted
owner_login Username of counter owner.
code_status Installation status of counter code.

Possible values:

  • CS_ERR_INFECTED — unable to verify (the site on which the counter is installed, or one of its mirrors, is in the list of infected sites).
  • CS_NOT_FOUND — Not installed.
  • CS_ERR_OTHER_HTML_CODE — another counter installed.
  • CS_ERR_CONNECT — unable to verify (connection error).
  • CS_ERR_TIMEOUT — unable to verify (timeout).
  • CS_OK — Correctly installed.
code_status_info Information on counter status.
name Name of counter.
site2 Full site domain.
type Counter type.

Possible values:

  • partner — counter imported from YAN.
  • simple — counter created by user in Yandex.Metrica;
favorite Is counter added to favorites.

Possible values:

  • 0 ― not added (by default);
  • 1 ― added.
permission Access level to counter.

Possible values:

  • view — guest counter with access level “page views only”;
  • edit — guest counter with access level “full access”.
  • own — counter, owned by a user;
mirrors2 List of site mirrors (domains).
goals List of structures with information on counter goals.
filters List of structures with information on counter filters.
operations List of structures with information about counter actions.
grants List of structures with information on access rights to counter.
labels List of structures with information about tags.
webvisor Structure with information about Session Replay settings.
code_options Counter code settings.
create_time Date and time when counter was created.
time_zone_name Time zone for calculation of statistics.
time_zone_offset Current time zone offset from Greenwich, minutes
update_time Time counter was last changed.
code

HTML-code of counter

monitoring

Site availability monitoring settings.

filter_robots Robot filtering.

Possible values:

  • 0 — factor in sessions of all robots;
  • 1 — only filter robots by strict rules (by default);
  • 2 — filter robots by strict rules and by behavior
visit_threshold Session timeout in seconds.
offline_options Offline event settings.
code_status_info
length Content length in bytes.
found Number of valid Yandex.Metrica codes found.
match Number of valid codes for verified counter found.
http_code HTTP response status code (“200” on success).
http_msg String displaying the HTTP status response code (“OK” on success).
duration Site response time in seconds.
infected Infected site (site on which a counter is installed, or is one of its mirrors).
site2
site Full site domain.
mirrors2
site Full site domain.
filters
id

Filter ID. Specify this parameter when changing a counter filter

attr Type of data, to which a filter is applied.

Possible values:

  • referer — referrer;
  • uniq_id — special filter attribute “don't factor in my sessions”.
  • client_ip — IP-address;
  • title — page title;
  • url — page URL;
type Filter type or action for filter.

Possible values:

  • equal — equals;
  • contain — contains;
  • me — my visits, used only with the type of data attr = uniq_id;
  • start — begins with;
  • interval — in the interval, is used only with data type “IP-address” (attr = client_ip);
  • only_mirrors — only site and mirrors, used only for data type “page URL” (attr = url) and filter type “only record traffic” (action = include), as well as when mirrors are specified for the counter.
value Filter value.
action Filter type.

Possible values:

  • include — keep traffic only.
  • exclude — exclude traffic;
status Filter status.

Possible values:

  • active — filter is used;
  • disabled — filter disabled (without deletion).
start_ip First IP-address range.
end_ip Last IP-address of range.
with_subdomains Filter by subdomains.
operations
id

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

action Action type.

Possible values:

  • cut_parameter — remove specific parameter from URL;
  • replace_domain — replace domain.
  • to_lower — convert to lower case;
  • merge_https_and_http — replace https:// with http://;
  • cut_fragment — remove anchor from URL;
  • cut_all_parameters — cut all parameters from URL;
attr Field for filtration.

Possible values:

  • referer — referrer;
  • url — page URL.
value Value for replacement.
status Action status.

Possible values:

  • active — action is used;
  • disabled — action disabled (without deletion).
grants
user_login

Login of user, which has been granted permission to manage counter.

Parameter contains empty string, if public access is provided to the statistics of the counter (perm = public_stat)

perm Access level.

Possible values:

  • view — page views only;
  • edit — full access.
  • public_stat — public access to statistics;
created_at

Date of granting access in the format YYYY-MM-DD'T'hh:mm:ssZ.

comment

Any comment. 255 characters maximum.

labels
id Tag ID.
name Tag name.
webvisor
urls List of pages for saving.
arch_enabled Saving pages of site.

Possible values:

  • 0 ― disabled (by default);
  • 1 ― enabled.
arch_type Record of page content.

Possible values:

  • load — download from site;
  • html — from browser.
  • none — disabled;
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 Запись содержимого полей и форм.

Possible values:

  • 0 - не записывать содержимое полей и форм за исключением тех из них, которые помечены css-классом -metrika-recordkeys;
  • 1 - записывать содержимое полей и форм за исключением тех из них, которые помечены css-классом -metrika-nokeys (по умолчанию).
code_options
async Asynchronous code of counter.

Possible values:

  • 0 ― disabled;
  • 1 ― enabled (by default).
informer Informer settings.
visor Recording and analysis of site user behavior.

Possible values:

  • 0 ― disabled (by default);
  • 1 ― enabled.
track_hash Hash tracking in browser address bar. Option applies to AJAX sites.

Possible values:

  • 0 ― disabled (by default);
  • 1 ― enabled.
xml_site For XML-sites. The noscript element should not be used in XML documents.

Possible values:

  • 0 ― disabled (by default);
  • 1 ― enabled.
clickmap Gathering statistics for the click map report.

Possible values:

  • 0 ― disabled;
  • 1 ― enabled (by default).
in_one_line Remove counter code in one string.

Possible values:

  • 0 ― disabled (by default);
  • 1 ― enabled.
ecommerce

Possible values:

  • 0 ― disabled (by default);
  • 1 ― enabled.
informer
enabled Permission for display of informer.

Possible values:

  • 0 ― informer is not displayed (by default);
  • 1 ― informer is displayed.
type Informer type.

Possible values:

  • ext — advanced (by default).
  • simple — simple;
size Size of informer.

Possible values:

  • 1 - size 80х15;
  • 2 - size 80х31;
  • 3 - size 88х31 (by default). Does not affect the value of the indicator field in view of informer of this type.
indicator Parameter which will be displayed on the informer.

Possible values:

  • visits — Sessions;
  • pageviews — pageviews (by default);
  • uniques — users.
color_start Beginning (top) color of informer in the format RRGGBBAA. RR, GG, BB are saturated red, green and blue colors. The level of saturation for every color is assigned a value ranging from 00 to FF. AA is transparency from 00 (transparent) to FF (opaque).
color_end Ending (lower) color of informer in the format RRGGBBAA. The parameter is intended for creating background gradient. Color saturation and transparency are analogously given the parameter color_start.
color_text Text color on informer.

Possible values:

  • 0 ― black (by default);
  • 1 ― white.
color_arrow Arrow color on informer.

Possible values:

  • 0 ― black;
  • 1 ― violet (by default).
monitoring
enable_monitoring

Notifications for monitoring site availability. Possible values:

  • 0 — user is not subscribed to notifications (by default);
  • 1 — monitoring notifications enabled.
emails

List of email addresses for getting site monitoring notifications. Can contain one or several addresses, separated by commas

sms_allowed

SMS-notifications. To receive notifications you need to subscibe and confirm your subscription. Phone number is stored in the user's personal data for all Yandex services.

Possible values:

  • 0 — user did not enter mobile phone number;
  • 1 — user entered mobile phone number and confirmed subscription.
enable_sms

SMS-notifications for monitoring site availability. Possible values:

  • 0 — user is not subscribed to SMS-notifications (by default);
  • 1 — subscribed to SMS monitoring notifications.
sms_time

Permitted time ranges for sending SMS-notifications. The ranges are specified by days of the week from Monday to Sunday. If the range is not specified for a particular day, SMS-notifications will not be sent on that day.

Days of the week are separated by semicolons, as shown in the following example:

8-9;8-9;;20-22;;;

This value permits the sending of SMS from 8:00 to 9:59 on Monday and Tuesday and from 20:00 to 22:59 on Thursday.

Each specified hour corresponds to an interval of time from the beginning until the end of that hour. So, the number 9 indicates the interval beween 9 hours 00 minutes and 9 hours 59 minutes inclusive.

Ranges can consist of "to-from" intervals and individual hours, for example 7-12,16,18,22-23. The components of such ranges are separated by commas.

phones

List of telephone numbers for getting site monitoring notifications. Can contain one or several numbers, separated by commas

offline_options
offline_conversion_extended_threshold Extended period for tracking offline conversions.

Possible values:

  • 0 ― disabled (by default);
  • 1 ― enabled.
offline_calls_extended_threshold Extended call tracking period.

Possible values:

  • 0 ― disabled (by default);
  • 1 ― enabled.
offline_visits_extended_threshold Extended tracking period for offline visits.

Possible values:

  • 0 ― disabled (by default);
  • 1 ― enabled.