---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/dev/direct/doc/dg-v4/en/live/GetStatGoals.md
  - https://yandex.com/dev/direct/doc/dg-v4/ru/live/GetStatGoals.md
  - href: en/live/GetStatGoals.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/direct/doc/dg-v4/en/llms.txt

# GetStatGoals (Live)
Returns information about the Yandex Metrica goals that are available for the campaign.
Information about goals is used in two cases:

- When generating a statistical report using the [CreateNewReport (Live)](https://yandex.com/dev/direct/doc/dg-v4/en/live/CreateNewReport.md) method, the goal ID can be set in the StatGoals parameter.
    
- In the CreateOrUpdateCampaign (Live) method for the CPAOptimizer or AverageCPAOptimization automatic strategy, the goal ID can be specified in the GoalID parameter.
    

## 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](https://yandex.com/dev/direct/doc/dg-v4/en/reference/GetStatGoals.md)).

Added the AvailableForStrategy output parameter.

Added the AvailableForContextStrategy output parameter.

Added the GoalsReached and ContextGoalsReached output parameters.


## Input data {#input}

The input data structure in JSON is shown below.

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

Parameters are described below.


#|
||
**<sup >Parameter</sup>**
|
**<sup >Description</sup>**
|
**<sup >Required</sup>**
||

||
**<sub >CampaignIDInfo object</sub>**
||
||
`CampaignIDS`
|
Array of campaign IDs (no more than 100).
|
Yes
||
|#


## Output data {#output}

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.

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

Parameters are described below.


#|
||
**<sup >Parameter</sup>**
|
**<sup >Description</sup>**
||

||
**<sub >StatGoalInfo object</sub>**
||
||
`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 {#example}

## Python

```python
{
   'CampaignIDS': [1327944, 1342794]
}
```

## PHP

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

## Perl

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


