Изменение цели

Изменяет настройки указанной цели счетчика.

Request

PUT

https://api-metrika.yandex.net/management/v1/counter/{counterId}/goal/{goalId}

Path parameters

Name

Description

counterId

Type: integer

Идентификатор счетчика, цель которого вы хотите изменить.

goalId

Type: integer

Идентификатор цели, настройки которой вы хотите изменить.

Body

application/json
{
  "goal": {
    "id": 0,
    "name": "example",
    "type": "example",
    "default_price": 0.5,
    "is_retargeting": true,
    "is_favorite": true,
    "status": "example",
    "conditions": [
      {}
    ],
    "prev_goal_id": 0,
    "flag": "example"
  }
}

Name

Description

goal

One of 13 types
  • Type: ActionGoal

    JavaScript-событие.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
    
  • Type: ChatGoal

    Нажатие на чат.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "conditions": [
        null
      ]
    }
    
  • Type: CompositeGoal

    Составная цель. Нужна для группировки и задания порядка обычных целей. В качестве шагов может содержать цели типа "Посещение страниц" и "JavaScript-событие". Шаг считается достигнутым, если были достигнуты все предыдущие шаги, и после этого были выполнены все условия текущего шага.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "steps": [
        {
          "id": 0,
          "name": "example",
          "type": "example",
          "default_price": 0.5,
          "is_retargeting": true,
          "is_favorite": true,
          "status": "example",
          "conditions": [
            {}
          ],
          "prev_goal_id": 0,
          "flag": "example"
        }
      ]
    }
    
  • Type: DepthGoal

    Количество просмотров. Цель считается достигнутой, если посетитель просмотрел заданное количество страниц сайта.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "depth": 2
    }
    
  • Type: EmailGoal

    Нажатие на email.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
    
  • Type: FileGoal

    Скачивание файлов. Цель считается достигнутой, если посетитель скачал любой файл или определенный файл.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
    
  • Type: MessengerGoal

    Переход в мессенджер. Цель будет достигнута при клике пользователем на ссылку, которая ведет в мессенджер.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
    
  • Type: PaymentSystemGoal

    Платежные системы. Цель считается достигнутой, если посетитель совершил оплату через платежную систему.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: PhoneGoal

    Нажатие на номер телефона.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example",
      "hide_phone_number": true
    }
    
  • Type: SiteSearchGoal

    Поиск по сайту. Цель будет достигнута при поиске на сайте, если в урле в get-параметрах есть хотя бы одно совпадение.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
    
  • Type: SocialNetworkGoal

    Переход в социальную сеть. Цель будет достигнута при клике пользователем на ссылку, которая ведет в социальную сеть.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
    
  • Type: UrlGoal

    Посещение страниц. Достигается, когда выполняется хотя бы одно из условий.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example",
      "price_locations": [
        {
          "type_of_path": "example",
          "path": "example"
        }
      ]
    }
    
  • Type: VisitDurationGoal

    Продолжительность визита. Цель будет достигнута при времени визита больше заданного.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "duration": 1
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "prev_goal_id": 0,
  "flag": "example"
}

GoalE

Name

Description

name

Type: string

Наименование цели.

Min length: 0

Max length: 255

Example: example

type

Type: string

Тип цели:

  • action — JavaScript-событие.
  • chat — клик по чату.
  • email — клик по email.
  • file — скачивание файлов.
  • messenger — переход в мессенджер.
  • number — количество просмотров.
  • payment_system — платежная система.
  • phone — клик по номеру телефона.
  • search — поиск по сайту.
  • social — переход в соцсети.
  • step — составная цель.
  • url — посещение страниц.
  • visit_duration — продолжительность визита.

Example: example

default_price

Type: number

Цена цели по умолчанию.

id

Type: integer

Идентификатор цели. Укажите данный параметр при изменении и удалении цели счетчика.

is_favorite

Type: boolean

Является ли цель избранной:

  • 0 ― не является (по умолчанию).
  • 1 ― является.

status

Type: string

Example: example

Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_favorite": true,
  "status": "example"
}

GoalCondition

Список структур с условиями цели.

Name

Description

type

Type: string

Тип условия:

  • contain — содержит;
  • exact — совпадает;
  • start — начинается с;
  • regexp — удовлетворяет регулярному выражению;
  • action — специальный тип условия для целей «JavaScript-событие»;
  • messenger — специальный тип условия для целей типа form, путь в dom дереве;
  • all_files — признак для целей «Переход в мессенджер»;
  • file — скачивание конкретного файла для целей «Скачивание файлов»;
  • search — признак для целей «Поиск по сайту»;
  • all_social — специальный тип условия для целей типа social (все социальные сети);
  • social — специальный тип условия для целей типа social (конкретная социальная сеть);
  • regexp_action — js-событие удовлетворяет регулярному выражению (используется только в шаге составной цели);
  • contain_action — js-событие содержит (используется только в шаге составной цели).

Example: example

url

Type: string

Значение зависит от типа цели:

  • Посещение страниц. Адрес страницы или части страницы для условия.
  • Клик по email или Клик по номеру телефона. Email или номер телефона, который указан в ссылках на сайте. Подробнее о том, как отследить клик по email или номеру телефона.
  • Переход в мессенджер. Название мессенджера, полученное с помощью метода GET management/v1/messengers, или значение all_messengers.
  • Поиск по сайту. GET-параметр, который используется для поиска на сайте. Метрика автоматически распознает параметры q, text, query или search. Если на сайте используется другой параметр, укажите его в запросе.
  • Скачивание файлов. Имя файла, например example.pdf. Значение может быть пустым, если нужно отслеживать скачивание всех файлов на сайте.
  • Переход в социальную сеть. Название социальной сети, полученное с помощью метода GET management/v1/social_networks, или значение all_social.

Example: example

Example
{
  "type": "example",
  "url": "example"
}

ActionGoal

JavaScript-событие.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

ChatGoalCondition

Список структур с условиями цели.

Name

Description

field

Type: string

К чему применять цель.

Example: example

Example
{
  "field": "example"
}

ChatGoalConditionAnswered

All of 2 types
  • Type: ChatGoalCondition

    Список структур с условиями цели.

    Example
    {
      "field": "example"
    }
    
  • Type: object

    answered

    Type: boolean

    Статус ответа в чате.

    Example
    {
      "answered": true
    }
    
Example
{
  "field": "example",
  "answered": true
}

ChatGoalConditionPlatform

All of 2 types
  • Type: ChatGoalCondition

    Список структур с условиями цели.

    Example
    {
      "field": "example"
    }
    
  • Type: object

    platform

    Type: string

    Платформа чата. Возможные значения:

    • telegram;
    • viber;
    • whatsApp.

    Example: telegram

    Example
    {
      "platform": "telegram"
    }
    
Example
{
  "field": "example",
  "platform": "telegram"
}

ChatGoalConditionTag

All of 2 types
  • Type: ChatGoalCondition

    Список структур с условиями цели.

    Example
    {
      "field": "example"
    }
    
  • Type: object

    operator

    Type: string

    Тип условия. Возможные значения:

    • contain — содержит.
    • exact — совпадает.
    • start — начинается с.
    • regexp — удовлетворяет регулярному выражению.

    Example: example

    value

    Type: string

    Min length: 1

    Max length: 1024

    Example: example

    Example
    {
      "operator": "example",
      "value": "example"
    }
    
Example
{
  "field": "example",
  "operator": "example",
  "value": "example"
}

ChatGoal

Нажатие на чат.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: array
    One of 3 types
    Example
    [
      {
        "field": "example",
        "answered": true
      }
    ]
    
    Example
    {
      "conditions": [
        {
          "field": "example",
          "answered": true
        }
      ]
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "conditions": [
    null
  ]
}

ConditionalGoal

Список шагов составной цели.

Name

Description

name

Type: string

Наименование цели.

Min length: 0

Max length: 255

Example: example

type

Type: string

Тип цели:

  • action — JavaScript-событие.
  • chat — клик по чату.
  • email — клик по email.
  • file — скачивание файлов.
  • messenger — переход в мессенджер.
  • number — количество просмотров.
  • payment_system — платежная система.
  • phone — клик по номеру телефона.
  • search — поиск по сайту.
  • social — переход в соцсети.
  • step — составная цель.
  • url — посещение страниц.
  • visit_duration — продолжительность визита.

Example: example

conditions

Type: GoalCondition[]

Example
[
  {
    "type": "example",
    "url": "example"
  }
]

default_price

Type: number

Цена цели по умолчанию.

flag

Type: string

Тип цели для клиентов Яндекс Маркета:

  • basketкорзина, страница посещения корзины.
  • orderзаказ, страница подтверждения заказа.

Example: example

id

Type: integer

Идентификатор цели. Укажите данный параметр при изменении и удалении цели счетчика.

is_favorite

Type: boolean

Является ли цель избранной:

  • 0 ― не является (по умолчанию).
  • 1 ― является.

status

Type: string

Example: example

Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

CompositeGoal

Составная цель. Нужна для группировки и задания порядка обычных целей. В качестве шагов может содержать цели типа "Посещение страниц" и "JavaScript-событие". Шаг считается достигнутым, если были достигнуты все предыдущие шаги, и после этого были выполнены все условия текущего шага.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    steps

    Type: ConditionalGoal[]

    Min items: 0

    Max items: 5

    Example
    [
      {
        "id": 0,
        "name": "example",
        "type": "example",
        "default_price": 0.5,
        "is_retargeting": true,
        "is_favorite": true,
        "status": "example",
        "conditions": [
          {
            "type": "example",
            "url": "example"
          }
        ],
        "prev_goal_id": 0,
        "flag": "example"
      }
    ]
    
    Example
    {
      "steps": [
        {
          "id": 0,
          "name": "example",
          "type": "example",
          "default_price": 0.5,
          "is_retargeting": true,
          "is_favorite": true,
          "status": "example",
          "conditions": [
            {
              "type": "example",
              "url": "example"
            }
          ],
          "prev_goal_id": 0,
          "flag": "example"
        }
      ]
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "steps": [
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {}
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
  ]
}

DepthGoal

Количество просмотров. Цель считается достигнутой, если посетитель просмотрел заданное количество страниц сайта.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    depth

    Type: integer

    Количество просмотренных пользователем страниц.

    Min value: 2

    Example
    {
      "depth": 2
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "depth": 2
}

EmailGoal

Нажатие на email.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

FileGoal

Скачивание файлов. Цель считается достигнутой, если посетитель скачал любой файл или определенный файл.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

MessengerGoal

Переход в мессенджер. Цель будет достигнута при клике пользователем на ссылку, которая ведет в мессенджер.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

PaymentSystemGoal

Платежные системы. Цель считается достигнутой, если посетитель совершил оплату через платежную систему.

All of 1 type
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example"
}

PhoneGoal

Нажатие на номер телефона.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    hide_phone_number

    Type: boolean

    Скрывать номер телефона на десктопах.

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example",
      "hide_phone_number": true
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example",
  "hide_phone_number": true
}

SiteSearchGoal

Поиск по сайту. Цель будет достигнута при поиске на сайте, если в урле в get-параметрах есть хотя бы одно совпадение.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

SocialNetworkGoal

Переход в социальную сеть. Цель будет достигнута при клике пользователем на ссылку, которая ведет в социальную сеть.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

UrlGoal

Посещение страниц. Достигается, когда выполняется хотя бы одно из условий.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

VisitDurationGoal

Продолжительность визита. Цель будет достигнута при времени визита больше заданного.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    duration

    Type: integer

    Продолжительность визита в секундах.

    Min value: 1

    Example
    {
      "duration": 1
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "is_favorite": true,
  "status": "example",
  "duration": 1
}

LocationOnPage

Name

Description

path

Type: string

Местоположение на странице

Min length: 0

Max length: 4096

Example: example

type_of_path

Type: string

Тип указанного местоположения

Example: example

Example
{
  "type_of_path": "example",
  "path": "example"
}

Responses

200 OK

OK

Body

application/json
{
  "goal": {
    "id": 0,
    "name": "example",
    "type": "example",
    "default_price": 0.5,
    "is_retargeting": true,
    "goal_source": "example",
    "is_favorite": true,
    "status": "example",
    "conditions": [
      {}
    ],
    "prev_goal_id": 0,
    "flag": "example"
  }
}

Name

Description

goal

One of 13 types
  • Type: ActionGoal

    JavaScript-событие.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
    
  • Type: ChatGoal

    Нажатие на чат.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "conditions": [
        null
      ]
    }
    
  • Type: CompositeGoal

    Составная цель. Нужна для группировки и задания порядка обычных целей. В качестве шагов может содержать цели типа "Посещение страниц" и "JavaScript-событие". Шаг считается достигнутым, если были достигнуты все предыдущие шаги, и после этого были выполнены все условия текущего шага.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "steps": [
        {
          "id": 0,
          "name": "example",
          "type": "example",
          "default_price": 0.5,
          "is_retargeting": true,
          "goal_source": "example",
          "is_favorite": true,
          "status": "example",
          "conditions": [
            {}
          ],
          "prev_goal_id": 0,
          "flag": "example"
        }
      ]
    }
    
  • Type: DepthGoal

    Количество просмотров. Цель считается достигнутой, если посетитель просмотрел заданное количество страниц сайта.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "depth": 2
    }
    
  • Type: EmailGoal

    Нажатие на email.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
    
  • Type: FileGoal

    Скачивание файлов. Цель считается достигнутой, если посетитель скачал любой файл или определенный файл.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
    
  • Type: MessengerGoal

    Переход в мессенджер. Цель будет достигнута при клике пользователем на ссылку, которая ведет в мессенджер.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
    
  • Type: PaymentSystemGoal

    Платежные системы. Цель считается достигнутой, если посетитель совершил оплату через платежную систему.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: PhoneGoal

    Нажатие на номер телефона.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example",
      "hide_phone_number": true
    }
    
  • Type: SiteSearchGoal

    Поиск по сайту. Цель будет достигнута при поиске на сайте, если в урле в get-параметрах есть хотя бы одно совпадение.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
    
  • Type: SocialNetworkGoal

    Переход в социальную сеть. Цель будет достигнута при клике пользователем на ссылку, которая ведет в социальную сеть.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
    
  • Type: UrlGoal

    Посещение страниц. Достигается, когда выполняется хотя бы одно из условий.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "prev_goal_id": 0,
      "flag": "example",
      "price_locations": [
        {
          "type_of_path": "example",
          "path": "example"
        }
      ]
    }
    
  • Type: VisitDurationGoal

    Продолжительность визита. Цель будет достигнута при времени визита больше заданного.

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "duration": 1
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "prev_goal_id": 0,
  "flag": "example"
}

GoalE

Name

Description

name

Type: string

Наименование цели.

Min length: 0

Max length: 255

Example: example

type

Type: string

Тип цели:

  • action — JavaScript-событие.
  • chat — клик по чату.
  • email — клик по email.
  • file — скачивание файлов.
  • messenger — переход в мессенджер.
  • number — количество просмотров.
  • payment_system — платежная система.
  • phone — клик по номеру телефона.
  • search — поиск по сайту.
  • social — переход в соцсети.
  • step — составная цель.
  • url — посещение страниц.
  • visit_duration — продолжительность визита.

Example: example

default_price

Type: number

Цена цели по умолчанию.

goal_source

Type: string

Признак того, как создана цель:

Example: example

id

Type: integer

Идентификатор цели. Укажите данный параметр при изменении и удалении цели счетчика.

is_favorite

Type: boolean

Является ли цель избранной:

  • 0 ― не является (по умолчанию).
  • 1 ― является.

status

Type: string

Example: example

Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example"
}

ActionGoal

JavaScript-событие.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

ChatGoal

Нажатие на чат.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: array
    One of 3 types
    Example
    [
      {
        "field": "example",
        "answered": true
      }
    ]
    
    Example
    {
      "conditions": [
        {
          "field": "example",
          "answered": true
        }
      ]
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "conditions": [
    null
  ]
}

ConditionalGoal

Список шагов составной цели.

Name

Description

name

Type: string

Наименование цели.

Min length: 0

Max length: 255

Example: example

type

Type: string

Тип цели:

  • action — JavaScript-событие.
  • chat — клик по чату.
  • email — клик по email.
  • file — скачивание файлов.
  • messenger — переход в мессенджер.
  • number — количество просмотров.
  • payment_system — платежная система.
  • phone — клик по номеру телефона.
  • search — поиск по сайту.
  • social — переход в соцсети.
  • step — составная цель.
  • url — посещение страниц.
  • visit_duration — продолжительность визита.

Example: example

conditions

Type: GoalCondition[]

Example
[
  {
    "type": "example",
    "url": "example"
  }
]

default_price

Type: number

Цена цели по умолчанию.

flag

Type: string

Тип цели для клиентов Яндекс Маркета:

  • basketкорзина, страница посещения корзины.
  • orderзаказ, страница подтверждения заказа.

Example: example

goal_source

Type: string

Признак того, как создана цель:

Example: example

id

Type: integer

Идентификатор цели. Укажите данный параметр при изменении и удалении цели счетчика.

is_favorite

Type: boolean

Является ли цель избранной:

  • 0 ― не является (по умолчанию).
  • 1 ― является.

status

Type: string

Example: example

Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

CompositeGoal

Составная цель. Нужна для группировки и задания порядка обычных целей. В качестве шагов может содержать цели типа "Посещение страниц" и "JavaScript-событие". Шаг считается достигнутым, если были достигнуты все предыдущие шаги, и после этого были выполнены все условия текущего шага.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    steps

    Type: ConditionalGoal[]

    Min items: 0

    Max items: 5

    Example
    [
      {
        "id": 0,
        "name": "example",
        "type": "example",
        "default_price": 0.5,
        "is_retargeting": true,
        "goal_source": "example",
        "is_favorite": true,
        "status": "example",
        "conditions": [
          {
            "type": "example",
            "url": "example"
          }
        ],
        "prev_goal_id": 0,
        "flag": "example"
      }
    ]
    
    Example
    {
      "steps": [
        {
          "id": 0,
          "name": "example",
          "type": "example",
          "default_price": 0.5,
          "is_retargeting": true,
          "goal_source": "example",
          "is_favorite": true,
          "status": "example",
          "conditions": [
            {
              "type": "example",
              "url": "example"
            }
          ],
          "prev_goal_id": 0,
          "flag": "example"
        }
      ]
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "steps": [
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example",
      "conditions": [
        {}
      ],
      "prev_goal_id": 0,
      "flag": "example"
    }
  ]
}

DepthGoal

Количество просмотров. Цель считается достигнутой, если посетитель просмотрел заданное количество страниц сайта.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    depth

    Type: integer

    Количество просмотренных пользователем страниц.

    Min value: 2

    Example
    {
      "depth": 2
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "depth": 2
}

EmailGoal

Нажатие на email.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

FileGoal

Скачивание файлов. Цель считается достигнутой, если посетитель скачал любой файл или определенный файл.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

MessengerGoal

Переход в мессенджер. Цель будет достигнута при клике пользователем на ссылку, которая ведет в мессенджер.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

PaymentSystemGoal

Платежные системы. Цель считается достигнутой, если посетитель совершил оплату через платежную систему.

All of 1 type
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example"
}

PhoneGoal

Нажатие на номер телефона.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    hide_phone_number

    Type: boolean

    Скрывать номер телефона на десктопах.

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example",
      "hide_phone_number": true
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example",
  "hide_phone_number": true
}

SiteSearchGoal

Поиск по сайту. Цель будет достигнута при поиске на сайте, если в урле в get-параметрах есть хотя бы одно совпадение.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

SocialNetworkGoal

Переход в социальную сеть. Цель будет достигнута при клике пользователем на ссылку, которая ведет в социальную сеть.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

UrlGoal

Посещение страниц. Достигается, когда выполняется хотя бы одно из условий.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    conditions

    Type: GoalCondition[]

    Example
    [
      {
        "type": "example",
        "url": "example"
      }
    ]
    

    flag

    Type: string

    Тип цели для клиентов Яндекс Маркета:

    • basketкорзина, страница посещения корзины.
    • orderзаказ, страница подтверждения заказа.

    Example: example

    Example
    {
      "conditions": [
        {
          "type": "example",
          "url": "example"
        }
      ],
      "flag": "example"
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "conditions": [
    {
      "type": "example",
      "url": "example"
    }
  ],
  "flag": "example"
}

VisitDurationGoal

Продолжительность визита. Цель будет достигнута при времени визита больше заданного.

All of 2 types
  • Type: GoalE

    Example
    {
      "id": 0,
      "name": "example",
      "type": "example",
      "default_price": 0.5,
      "is_retargeting": true,
      "goal_source": "example",
      "is_favorite": true,
      "status": "example"
    }
    
  • Type: object

    duration

    Type: integer

    Продолжительность визита в секундах.

    Min value: 1

    Example
    {
      "duration": 1
    }
    
Example
{
  "id": 0,
  "name": "example",
  "type": "example",
  "default_price": 0.5,
  "is_retargeting": true,
  "goal_source": "example",
  "is_favorite": true,
  "status": "example",
  "duration": 1
}

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

Следующая