GetStatGoals

Returns information about the Yandex.Metrica goals that are available for the campaign. Goal IDs are used for filtering data in statistical reports.

Note. The GetStatGoals (Live) version also exists for this method.

When generating a statistical report using the CreateNewReport method, the goal ID can be set in the StatGoals parameter.

Input data

The input data structure in JSON is shown below.

{
   "method": "GetStatGoals",
   "param": {
      /* CampaignIDInfo */
      "CampaignID": (int)
   }
}

Parameters are described below.

ParameterDescriptionRequired
CampaignIDInfo object
CampaignIDThe campaign ID.Yes

Output data

The method returns an array of objects, each of which contains information about a goal associated with the campaign. The output data structure in JSON is shown below.

{
   "data": [
      {  /* StatGoalInfo */
         "GoalID": (int),
         "Name": (string)
      }
      ...
   ]
}

Parameters are described below.

ParameterDescription
StatGoalInfo object
GoalIDID of the goal.
NameThe name of the goal.

Examples of input data

Python

{
   'CampaignID': 1327944
}

PHP

array(
   'CampaignID' => 1327944
)

Perl

{
   'CampaignID' => 1327944
}