---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.ru/dev/direct/doc/dg-v4/en/reference/GetStatGoals.md
  - https://yandex.ru/dev/direct/doc/dg-v4/ru/reference/GetStatGoals.md
  - href: en/reference/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.ru/dev/direct/doc/dg-v4/en/llms.txt

# 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 info %}

The [GetStatGoals (Live)](https://yandex.ru/dev/direct/doc/dg-v4/en/live/GetStatGoals.md) version also exists for this method.

{% endnote %}


When generating a statistical report using the [CreateNewReport](https://yandex.ru/dev/direct/doc/dg-v4/en/reference/CreateNewReport.md) method, the goal ID can be set in the `StatGoals` parameter.


## Input data {#input}

The input data structure in JSON is shown below.

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

Parameters are described below.


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

||
**<sub >CampaignIDInfo object</sub>**
||
||
`CampaignID`
|
The campaign ID.
|
Yes
||
|#


## Output data {#output}

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.

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

Parameters are described below.


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

||
**<sub >StatGoalInfo object</sub>**
||
||
`GoalID`
|
ID of the goal.
||
||
`Name`
|
The name of the goal.
||
|#


## Examples of input data {#example}

## Python

```python
{
   'CampaignID': 1327944
}
```

## PHP

```php
array(
   'CampaignID' =1327944
)
```

## Perl

```perl
{
   'CampaignID' =1327944
}
```

