Changing action

Attention.

Access tokens will not be accepted in URL parameters starting February 13, 2019. To continue working with the Yandex.Metrica API, set up authorization by passing the token in the HTTP header.

The outdated authorization method will be temporarily disabled on January 23, January 30, and February 6 for maintenance. Authorization using URL parameters will be unavailable on these dates.

Changes setting of specified counter action.

  1. Request syntax
  2. Request message body
  3. Response format

Request syntax

counterId — counter ID, the action of which you want to change.

operationId — action ID, which you want to change.

https://api-metrica.yandex.net/management/v1/counter/{counterId}/operation/{operationId}
 ? 

Request message body


{
    "operation" : {
        "action" :  < operation_type > ,
        "attr" :  < operation_attribute > ,
        "value" :  < string > ,
        "status" :  < operation_status > 
    }
}
ParametersDescription
operationAction.
operation
actionAction 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;
attrField for filtration.

Possible values:

  • referer — referrer;
  • url — page URL.
valueValue for replacement.
statusAction status.

Possible values:

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

Request example

PUT https://api-metrica.yandex.net/management/v1/counter/{counterId}/operation/{operationId}?

Response format


{
    "operation" : {
        "id" :  < int > ,
        "action" :  < operation_type > ,
        "attr" :  < operation_attribute > ,
        "value" :  < string > ,
        "status" :  < operation_status > 
    }
}
ParametersDescription
operationAction.
operation
id

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

actionAction 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;
attrField for filtration.

Possible values:

  • referer — referrer;
  • url — page URL.
valueValue for replacement.
statusAction status.

Possible values:

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