GetStatGoals (Live)

Returns information about the Yandex.Metrica goals that are available for the campaign.

Information about goals is used in two cases:

New in the Live 4 version

A single method call can be used to get data on goals for multiple campaigns. Specify campaign IDs in the CampaignIDS parameter. The method also supports the stable version 4 format (see GetStatGoals).

Added the AvailableForStrategy output parameter.

Added the AvailableForContextStrategy output parameter.

Added the GoalsReached and ContextGoalsReached output parameters.

Input data

The input data structure in JSON is shown below.

{
   "method": "GetStatGoals",
   "param": {
      /* CampaignIDInfo */
      "CampaignIDS": [
         (int)
         ...
      ]
   }
}

Parameters are described below.

Parameter Description Required
CampaignIDInfo object
CampaignIDS Array of campaign IDs (no more than 100). Yes

Output data

The method returns an array of objects, each containing information about a single goal that is available for a campaign. The output data structure in JSON is shown below.

{
   "data": [
      {  /* StatGoalInfo */
         "CampaignID": (int),
         "GoalID": (int),
         "Name": (string),
         "AvailableForStrategy": (string),
         "AvailableForContextStrategy": (string),
         "GoalsReached": (int),
         "ContextGoalsReached": (int)
      }
      ...
   ]
}

Parameters are described below.

Parameter Description
StatGoalInfo object
CampaignID ID of the campaign that the goal is available for.
GoalID ID of the goal.
Name The name of the goal.
AvailableForStrategy The goal is appropriate for the CPAOptimizer, AverageCPAOptimization, or ROIOptimization automatic strategies — Yes/No on the search. Only non-compound goals are appropriate.
AvailableForContextStrategy The same meaning as the previous parameter, except it applies to strategies in the Yandex Advertising Network, not in the search.
GoalsReached How many times the goal was achieved for click-throughs from the search over the entire period while statistics were collected.
ContextGoalsReached How many times the goal was achieved for click-throughs from the Yandex Advertising Network over the entire period while statistics were collected.

Examples of input data

Python

{
   'CampaignIDS': [1327944, 1342794]
}

PHP

array(
   'CampaignIDS' => array(1327944, 1342794)
)

Perl

{
   'CampaignIDS' => [1327944, 1342794]
}