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.

ParameterDescriptionRequired
CampaignIDInfo object
CampaignIDSArray 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.

ParameterDescription
StatGoalInfo object
CampaignIDID of the campaign that the goal is available for.
GoalIDID of the goal.
NameThe name of the goal.
AvailableForStrategyThe goal is appropriate for the CPAOptimizer, AverageCPAOptimization, or ROIOptimization automatic strategies — Yes/No on the search. Only non-compound goals are appropriate.
AvailableForContextStrategyThe same meaning as the previous parameter, except it applies to strategies in the Yandex Advertising Network, not in the search.
GoalsReachedHow many times the goal was achieved for click-throughs from the search over the entire period while statistics were collected.
ContextGoalsReachedHow 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]
}