Creating a segment with the "pixel" type

Creates a pixel segment with the specified parameters. If different criteria are used when creating a segment (for example, multiple tags are set), the segment will include users who meet all the criteria simultaneously.

Request

POST

https://api-audience.yandex.com/v1/management/segments/create_pixel

Body

application/json
{
    "segment": {
        "name": "string",
        "pixel_id": 0,
        "period_length": 0,
        "times_quantity_operation": "string",
        "times_quantity": 0,
        "utm_source": "string",
        "utm_content": "string",
        "utm_campaign": "string",
        "utm_term": "string",
        "utm_medium": "string"
    }
}

Name

Description

segment*

Type: SegmentRequestPixel

The segment with the specified parameters.

SegmentRequestPixel

The segment with the specified parameters.

Name

Description

name*

Type: string

Segment name.

pixel_id*

Type: integer<int32>

The pixel ID.

period_length

Type: integer<int32>

The time period for tracking the user with the pixel. Acceptable values (in days): from 1 to 90 (inclusive).

Min value: 1

Max value: 90

times_quantity

Type: integer<int32>

Threshold value (M). This is the base number for comparing how many times the user was detected by the pixel during the period.

times_quantity_operation

Type: string

Condition for users to be included in the pixel segment. Acceptable values:

  • lt — Less than. The user was detected by the pixel less than M times during the period.
  • eq — Equal to. The user was detected by the pixel M times during the period.
  • gt — Greater than. The user was detected by the pixel more than M times during the period.

utm_campaign

Type: string

The utm_campaign tag. Can be used as a condition for including users in a pixel segment.

utm_content

Type: string

The utm_content tag. Can be used as a condition for including users in a pixel segment.

utm_medium

Type: string

The utm_medium tag. Can be used as a condition for including users in a pixel segment.

utm_source

Type: string

The utm_source tag. Can be used as a condition for including users in a pixel segment.

utm_term

Type: string

The utm_term tag. Can be used as a condition for including users in a pixel segment.

Responses

200 OK

OK

Body

application/json
{
    "segment": {
        "id": 0,
        "name": "string",
        "type": "string",
        "status": "string",
        "create_time": "2022-12-29T18:02:01Z",
        "owner": "string",
        "pixel_id": 0,
        "period_length": 0,
        "times_quantity": 0,
        "times_quantity_operation": "string",
        "utm_source": "string",
        "utm_content": "string",
        "utm_campaign": "string",
        "utm_term": "string",
        "utm_medium": "string"
    }
}

Name

Description

segment

Type: PixelSegment

A segment created using a tracking pixel.
The segment description by type.

PixelSegment

A segment created using a tracking pixel.

Name

Description

name*

Type: string

Segment name.

create_time

Type: string<date-time>

The time of segment creation.

id

Type: integer<int32>

ID of the segment. Specify this parameter when updating a segment.

owner

Type: string

The username of the segment owner.

period_length

Type: integer<int32>

The time period for tracking the user with the pixel. Acceptable values (in days): from 1 to 90 (inclusive).

pixel_id

Type: integer<int32>

The pixel ID.

status

Type: string

Status of processing the segment. Acceptable values:

  • uploaded – The segment with the user's data has been uploaded.
  • is_processed – The segment with the specified parameters is being processed.
  • processed – Uploading and processing the segment is complete. The segment is ready to use.
  • processing_failed – Processing the segment failed with an error.
  • is_updated — The segment is updated.
  • few_data – The segment doesn't have enough data.

times_quantity

Type: integer<int32>

Threshold value (M). This is the base number for comparing how many times the user was detected by the pixel during the period.

times_quantity_operation

Type: string

Condition for users to be included in the pixel segment. Acceptable values:

  • lt — Less than. The user was detected by the pixel less than M times during the period.
  • eq — Equal to. The user was detected by the pixel M times during the period.
  • gt — Greater than. The user was detected by the pixel more than M times during the period.

type

Type: string

Segment type. Acceptable values:

  • uploading: A segment created from a file with user data.
  • metrika: A segment imported from Yandex Metrica.
  • appmetrica: A segment imported from AppMetrica.
  • lookalike: A segment of users who "look like" one of the client's other segments (uses the "lookalike" technology).
  • geo: A segment based on location data for polygons and circles.
  • pixel: A segment created using a tracking pixel.

utm_campaign

Type: string

The utm_campaign tag. Can be used as a condition for including users in a pixel segment.

utm_content

Type: string

The utm_content tag. Can be used as a condition for including users in a pixel segment.

utm_medium

Type: string

The utm_medium tag. Can be used as a condition for including users in a pixel segment.

utm_source

Type: string

The utm_source tag. Can be used as a condition for including users in a pixel segment.

utm_term

Type: string

The utm_term tag. Can be used as a condition for including users in a pixel segment.

No longer supported, please use an alternative and newer version.