Creates a segment with set parameters. A segment created via the API is not displayed in the Yandex Metrica web interface. The API allows creating up to 500 segments for one tag, just like the web interface. This means the total possible number of segments is 1000.
counterId
: Tag ID.
POST https://api-metrika.yandex.net/management/v1/counter/{counterId}/apisegment/segments
{
"" : {
"" : < string > ,
"" : < string > ,
"" : < segment_source >
}
}
Parameters | Description |
segment | Segment. |
segment |
name | Segment name. |
expression | An expression that matches the value of the "filters" parameter. |
segment_source | Segment source. Indicates its creation method. Accepts the value api — uses segments created through the API. |
POST https://api-metrika.yandex.net/management/v1/counter/{counterId}/apisegment/segments
{
"" : {
"" : < integer > ,
"" : < integer > ,
"" : < string > ,
"" : < string > ,
"" : < segment_source >
}
}
Parameters | Description |
segment | Segment. |
segment |
segment_id | Segment ID. |
counter_id | Tag ID. |
name | Segment name. |
expression | An expression that matches the value of the "filters" parameter. |
segment_source | Segment source. Indicates its creation method. Accepts the value api — uses segments created through the API. |