Represents a shopping ad group.

### Methods:

| Member | Type | Description |
|---|---|---|
| [ads()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#ads) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_productadselector` | Returns the selector of all product ads in the shopping ad group. |
| [applyLabel(name)](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#applyLabel_name) | `void` | Applies a label to the shopping ad group. |
| [bidding()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#bidding) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroupbidding` | Provides access to this shopping ad group's bidding fields. |
| [createNegativeKeyword(keywordText)](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#createNegativeKeyword_keywordText) | `void` | Creates a new negative keyword with the specified text. |
| [createRootProductGroup()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#createRootProductGroup) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_productgroupoperation` | Creates the root product group of the shopping ad group (if one doesn't already exist). |
| [devices()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#devices) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_adgroupdevices` | Returns an [AdGroupDevices](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_adgroupdevices) instance associated with the shopping ad group. |
| [enable()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#enable) | `void` | Enables the shopping ad group. |
| [getCampaign()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#getCampaign) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingcampaign` | Returns the shopping campaign to which this shopping ad group belongs. |
| [getEntityType()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#getEntityType) | `String` | Returns the type of this entity as a `String`, in this case, `"ShoppingAdGroup"`. |
| [getId()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#getId) | `String` | Returns the ID of the shopping ad group. |
| [getMobileBidModifier()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#getMobileBidModifier) | `double` | Returns the mobile bid modifier for this ad group. |
| [getName()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#getName) | `String` | Returns the name of the shopping ad group. |
| [getResourceName()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#getResourceName) | `String` | Returns the resource name of the shopping ad group. |
| [getStatsFor(dateRange)](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#getStatsFor_dateRange) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats` | Returns stats for the specified date range. |
| [getStatsFor(dateFrom, dateTo)](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#getStatsFor_dateFrom-dateTo) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats` | Returns stats for the specified custom date range. |
| [isEnabled()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#isEnabled) | `boolean` | Returns `true` if the shopping ad group is enabled. |
| [isPaused()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#isPaused) | `boolean` | Returns `true` if the shopping ad group is paused. |
| [isRemoved()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#isRemoved) | `boolean` | Returns `true` if the shopping ad group is removed. |
| [labels()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#labels) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_labelselector` | Creates a selector of all labels applied to the shopping ad group. |
| [negativeKeywords()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#negativeKeywords) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_negativekeywordselector` | Returns a selector of all negative keywords in the ad group. |
| [newAdBuilder()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#newAdBuilder) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_productadbuilder` | Returns a product ad builder. |
| [pause()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#pause) | `void` | Pauses the shopping ad group. |
| [productGroups()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#productGroups) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_productgroupselector` | Returns the selector of all product groups in the shopping ad group. |
| [recommendations()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#recommendations) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_recommendationselector` | Returns the selector of all recommendations for this ad group. |
| [removeLabel(name)](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#removeLabel_name) | `void` | Removes a label from the shopping ad group. |
| [rootProductGroup()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#rootProductGroup) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_productgroup` | Returns the root product group of the shopping ad group or `null` if one does not exist. |
| [setMobileBidModifier(modifier)](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#setMobileBidModifier_modifier) | `void` | Sets the mobile bid modifier for this ad group to the specified value. |
| [setName(name)](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#setName_name) | `void` | Sets the name of the shopping ad group. |
| [targeting()](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#targeting) | `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgrouptargeting` | Provides access to this shopping ad group's targeting criteria: audiences |

## `ads()`

Returns the selector of all product ads in the shopping ad group.

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_productadselector` | The selector of all product ads in the shopping ad group. |

## `applyLabel(name)`

Applies a label to the shopping ad group. `name` of the label is case-sensitive. Operation will fail if the label with the specified name does not already exist in the account.

Note that the shopping ad group cannot have more than 50 labels.

Returns nothing.

### Arguments:

| Name | Type | Description |
|---|---|---|
| name | `String` | Name of the label to apply. |

## `bidding()`

Provides access to this shopping ad group's bidding fields.

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroupbidding` | Access to this shopping ad group's bidding fields. |

## `createNegativeKeyword(keywordText)`

Creates a new negative keyword with the specified text.

Match type for the new negative keyword is specified as follows:

- `createNegativeKeyword("shoes")` - broad match.
- `createNegativeKeyword("\"shoes\"")` - phrase match.
- `createNegativeKeyword("[leather shoes]")` - exact match.

Returns nothing.

### Arguments:

| Name | Type | Description |
|---|---|---|
| keywordText | `String` | The text of the new negative keyword. |

## `createRootProductGroup()`

Creates the root product group of the shopping ad group (if one doesn't already exist). Newly constructed shopping ad groups as well as ones modified by other means may not have any product groups.

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_productgroupoperation` | The operation resulting from trying to create the root product group for this shopping ad group. |

## `devices()`

Returns an [AdGroupDevices](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_adgroupdevices) instance associated with the shopping ad group.

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_adgroupdevices` | An [AdGroupDevices](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_adgroupdevices) instance associated with the shopping ad group. |

## `enable()`

Enables the shopping ad group.

Returns nothing.

## `getCampaign()`

Returns the shopping campaign to which this shopping ad group belongs.

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingcampaign` | The shopping campaign to which this shopping ad group belongs. |

## `getEntityType()`

Returns the type of this entity as a `String`, in this case, `"ShoppingAdGroup"`.

### Return values:

| Type | Description |
|---|---|
| `String` | Type of this entity: `"ShoppingAdGroup"`. |

## `getId()`

Returns the ID of the shopping ad group.

### Return values:

| Type | Description |
|---|---|
| `String` | The ID of the shopping ad group. |

## `getMobileBidModifier()`

Returns the mobile bid modifier for this ad group.

The bid modifier is a multiplier applied to the shopping ad group's bids
on mobile devices. So, for instance, a bid modifier of `1.1`
increases the bid to 110% of its original value, and changes a bid of $5.00
to $5.50.

Note that when you set a mobile bid modifier at both campaign- and ad
group-level in a single campaign, the shopping ad group mobile bid modifier
will be used when determining your bid.

For more information about bid modifiers, please see the [Google Ads Help
Center article](https://support.google.com/google-ads/answer/6167121).

> [!WARNING]
> **Deprecated.** Google Ads Scripts now supports desktop and tablet ad group bid modifiers in addition to mobile. This functionality is available in the [AdGroupDevices](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_adgroupdevices) class, accessible via the [ShoppingAdGroup.devices](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#devices) method.

### Return values:

| Type | Description |
|---|---|
| `double` | The mobile bid modifier. |

## `getName()`

Returns the name of the shopping ad group.

### Return values:

| Type | Description |
|---|---|
| `String` | Name of the shopping ad group. |

## `getResourceName()`

Returns the resource name of the shopping ad group.

### Return values:

| Type | Description |
|---|---|
| `String` | The resource name of the shopping ad group. |

## `getStatsFor(dateRange)`

Returns stats for the specified date range. Supported values:

`TODAY, YESTERDAY, LAST_7_DAYS, THIS_WEEK_SUN_TODAY, LAST_WEEK,
LAST_14_DAYS, LAST_30_DAYS, LAST_BUSINESS_WEEK, LAST_WEEK_SUN_SAT,
THIS_MONTH, LAST_MONTH, ALL_TIME`.

Example:

```
var stats = shoppingAdGroup.getStatsFor("THIS_MONTH");
```

### Arguments:

| Name | Type | Description |
|---|---|---|
| dateRange | `String` | Date range for which the stats are requested. |

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats` | The stats for the specified date range. |

## `getStatsFor(dateFrom, dateTo)`

Returns stats for the specified custom date range. Both parameters can be either an object containing year, month, and day fields, or an 8-digit string in `YYYYMMDD` form. For instance, `March 24th,
2013` is represented as either `{year: 2013, month: 3, day:
24}` or `"20130324"`. The date range is inclusive on both ends, so `forDateRange("20130324", "20130324")` defines a range of a single day.

### Arguments:

| Name | Type | Description |
|---|---|---|
| dateFrom | `Object` | Start date of the date range. Must be either a string in `YYYYMMDD` form, or an object with `year`, `month` and `day` properties. |
| dateTo | `Object` | End date of the date range. Must be either a string in `YYYYMMDD` form, or an object with `year`, `month` and `day` properties. |

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_stats` | The stats for the specified date range. |

## `isEnabled()`

Returns `true` if the shopping ad group is enabled.

### Return values:

| Type | Description |
|---|---|
| `boolean` | `true` if the shopping ad group is enabled. |

## `isPaused()`

Returns `true` if the shopping ad group is paused.

### Return values:

| Type | Description |
|---|---|
| `boolean` | `true` if the shopping ad group is paused. |

## `isRemoved()`

Returns `true` if the shopping ad group is removed.

### Return values:

| Type | Description |
|---|---|
| `boolean` | `true` if the shopping ad group is removed. |

## `labels()`

Creates a selector of all labels applied to the shopping ad group.

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_labelselector` | Selector of all labels applied to the shopping ad group. |

## `negativeKeywords()`

Returns a selector of all negative keywords in the ad group.

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_negativekeywordselector` | The selector of all negative keywords in the ad group. |

## `newAdBuilder()`

Returns a product ad builder.

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_productadbuilder` | A product ad builder. |

## `pause()`

Pauses the shopping ad group.

Returns nothing.

## `productGroups()`

Returns the selector of all product groups in the shopping ad group.

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_productgroupselector` | The selector of all product groups in the shopping ad group. |

## `recommendations()`

Returns the selector of all recommendations for this ad group.

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_recommendationselector` | The selector of all recommendations for this ad group. |

## `removeLabel(name)`

Removes a label from the shopping ad group. `name` of the label is case-sensitive. Operation will fail if the label with the specified name does not already exist in the account.

Returns nothing.

### Arguments:

| Name | Type | Description |
|---|---|---|
| name | `String` | Name of the label. |

## `rootProductGroup()`

Returns the root product group of the shopping ad group or `null` if one does not exist.

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_productgroup` | The root product group of the shopping ad group or `null` if one does not exist. |

## `setMobileBidModifier(modifier)`

Sets the mobile bid modifier for this ad group to the specified value.

The bid modifier is a multiplier applied to the shopping ad group's bids
on mobile devices. So, for instance, a bid modifier of `1.1`
increases the bid to 110% of its original value, and changes a bid of $5.00
to $5.50.

Note that when you set a mobile bid modifier at both campaign- and ad
group-level in a single campaign, the shopping ad group mobile bid modifier
will be used when determining your bid.

For more information about bid modifiers, please see the [Google Ads Help
Center article](https://support.google.com/google-ads/answer/6167121).

> [!WARNING]
> **Deprecated.** Google Ads Scripts now supports desktop and tablet ad group bid modifiers in addition to mobile. This functionality is available in the [AdGroupDevices](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_adgroupdevices) class, accessible via the [ShoppingAdGroup.devices](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroup#devices) method.

Returns nothing.

### Arguments:

| Name | Type | Description |
|---|---|---|
| modifier | `double` | The new mobile bid modifier. |

## `setName(name)`

Sets the name of the shopping ad group.

Returns nothing.

### Arguments:

| Name | Type | Description |
|---|---|---|
| name | `String` | The new name for the shopping ad group. |

## `targeting()`

Provides access to this shopping ad group's targeting criteria: audiences

[ShoppingAdGroupAudience](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgroupaudience)

### Return values:

| Type | Description |
|---|---|
| `https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_shoppingadgrouptargeting` | Access to this ad group's targeting criteria. |