Statistics common to various entity types.

Typical usage:

```
var stats = campaign.getStatsFor("LAST_MONTH");
var impressions = stats.getImpressions();
var metrics.clicks = stats.getClicks();
// etc.
```

Note that Analytics-related stats ([Stats.getAveragePageviews()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getAveragePageviews),
[Stats.getAverageTimeOnSite()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getAverageTimeOnSite)
and [Stats.getBounceRate()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getBounceRate))
are only available for Campaigns, Ad groups, Keywords, and Ads. The method
calls will return `null` for other entity types.

### Methods:

| Member | Type | Description |
|---|---|---|
| [getAverageCpc()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getAverageCpc) | `double` | Returns the average cost per click. |
| [getAverageCpm()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getAverageCpm) | `double` | Returns the average cost per thousand impressions. |
| [getAverageCpv()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getAverageCpv) | `double` | Returns the average cost per view. |
| [getAveragePageviews()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getAveragePageviews) | `double` | Returns the average number of pages viewed per visit. |
| [getAveragePosition()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getAveragePosition) | `double` | Returns the average position. |
| [getAverageTimeOnSite()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getAverageTimeOnSite) | `double` | Returns the average time a visitor spent on site, in seconds. |
| [getBounceRate()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getBounceRate) | `double` | Returns the bounce rate of the entity, in `0..1` range. |
| [getClicks()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getClicks) | `long` | Returns the number of clicks. |
| [getConversionRate()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getConversionRate) | `double` | Returns the rate of conversions. |
| [getConversions()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getConversions) | `double` | Returns the number of conversions. |
| [getCost()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getCost) | `double` | Returns the cost in the default currency of the account. |
| [getCtr()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getCtr) | `double` | Returns the click through rate of the entity, in `0..1` range. |
| [getImpressions()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getImpressions) | `long` | Returns the number of impressions. |
| [getViewRate()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getViewRate) | `double` | Returns the view rate of the entity, in `0..1` range. |
| [getViews()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats#getViews) | `long` | Returns the number of video views. |

## `getAverageCpc()`

Returns the average cost per click.

### Return values:

| Type | Description |
|---|---|
| `double` | The average cost per click. |

## `getAverageCpm()`

Returns the average cost per thousand impressions.

### Return values:

| Type | Description |
|---|---|
| `double` | The average cost per thousand impressions. |

## `getAverageCpv()`

Returns the average cost per view.

### Return values:

| Type | Description |
|---|---|
| `double` | The average cost per view. |

## `getAveragePageviews()`

Returns the average number of pages viewed per visit. Only available for Campaigns, Ad groups, Keywords, and Ads. Returns `null` for other entity types. Returns `null` if the account is not linked to Analytics.

### Return values:

| Type | Description |
|---|---|
| `double` | The average page views. |

## `getAveragePosition()`

Returns the average position. Returns `null` if this is a Display entity that doesn't have an average position.

> [!WARNING]
> **Deprecated.**Starting the week of September 30, 2019 this method will return null.

### Return values:

| Type | Description |
|---|---|
| `double` | The average position. |

## `getAverageTimeOnSite()`

Returns the average time a visitor spent on site, in seconds. Only available for Campaigns, Ad groups, Keywords, and Ads. Returns `null` for other entity types. Returns `null` if the account is not linked to Analytics.

### Return values:

| Type | Description |
|---|---|
| `double` | The average time on site. |

## `getBounceRate()`

Returns the bounce rate of the entity, in `0..1` range. When a visitor to your site sees only one page or triggers only one event, Analytics considers this visit a "bounce." Only available for Campaigns, Ad groups, Keywords, and Ads. Returns `null` for other entity types. Returns `null` if the account is not linked to Analytics.

### Return values:

| Type | Description |
|---|---|
| `double` | The bounce rate. |

## `getClicks()`

Returns the number of clicks.

### Return values:

| Type | Description |
|---|---|
| `long` | The number of clicks. |

## `getConversionRate()`

Returns the rate of conversions.

### Return values:

| Type | Description |
|---|---|
| `double` | The rate of conversions. |

## `getConversions()`

Returns the number of conversions.

### Return values:

| Type | Description |
|---|---|
| `double` | The number of conversions. |

## `getCost()`

Returns the cost in the default currency of the account.

### Return values:

| Type | Description |
|---|---|
| `double` | The cost in the default currency of the account. |

## `getCtr()`

Returns the click through rate of the entity, in `0..1` range.

### Return values:

| Type | Description |
|---|---|
| `double` | The click through rate. |

## `getImpressions()`

Returns the number of impressions.

### Return values:

| Type | Description |
|---|---|
| `long` | The number of impressions. |

## `getViewRate()`

Returns the view rate of the entity, in `0..1` range.

### Return values:

| Type | Description |
|---|---|
| `double` | The view rate. |

## `getViews()`

Returns the number of video views.

### Return values:

| Type | Description |
|---|---|
| `long` | The number of video views. |