Google Ads provides several asset optimizations that can be performed automatically
to improve the ad strength of your ads.

These range from automatically creating image assets with a preview of an ad's
landing page, to optimizing video assets for different formats and different
lengths.

Each asset automation setting has an
[`asset_automation_type`](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt), which defines the type of
asset automation it represents, and an
[`asset_automation_status`](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationStatusEnum.AssetAutomationStatus.md.txt), which represents whether
the automation is enabled or disabled.

Some asset automations are configured at the campaign level, while others are
set at the ad group ad level.

## Campaign-level asset automation settings

These configure an asset automation for an entire campaign.
Not all of them are available for every campaign type: refer to the
[reference documentation](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt) for further details.

| Asset automation type | Supported campaign types | Default |
|---|---|---|
| [AUTOMATED_VIDEO_CRAWL](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#automated_video_crawl) | Performance Max | Disabled (available starting in v25) Allows Google to find and use videos from your landing page, YouTube channel, and organic social channels linked on your landing page. When you opt in, you can configure the [`automated_video_crawl_setting`](https://developers.google.com/google-ads/api/reference/rpc/v26/Campaign.AssetAutomationSetting.md.txt#automated_video_crawl_setting) field. |
| [FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#final_url_expansion_text_asset_automation) | Performance Max, Search | Enabled for Performance Max, disabled for Search. **Note:** Enabling final URL expansion will result in Google dynamically generating text assets (headlines and descriptions) to match the content of dynamically selected landing pages. This cannot be opted out of if final URL expansion is active. Contrast this with standard [TEXT_ASSET_AUTOMATION](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#text_asset_automation) (text customization), which customizes copy across all ads in the campaign. |
| [GENERATE_ENHANCED_YOUTUBE_VIDEOS](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#generate_enhanced_youtube_videos) | Performance Max | Enabled |
| [GENERATE_IMAGE_ENHANCEMENT](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#generate_image_enhancement) | Performance Max | Enabled |
| [GENERATE_IMAGE_EXTRACTION](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#generate_image_extraction) | Performance Max | The account-level Dynamic Image Extension control value. **Note:** This account-level setting can only be configured in the Google Ads web interface. |
| [TEXT_ASSET_AUTOMATION](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#text_asset_automation) | Performance Max, Search | Enabled for Performance Max, disabled for Search |

The following snippet shows how to set asset automation settings to `OPTED_IN`
for a Performance Max campaign:


### Java

```java
// Configures the optional opt-in/out status for asset automation settings.
.addAllAssetAutomationSettings(ImmutableList.of(
    AssetAutomationSetting.newBuilder()
        .setAssetAutomationType(AssetAutomationType.GENERATE_IMAGE_EXTRACTION)
        .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
    AssetAutomationSetting.newBuilder()
        .setAssetAutomationType(
            AssetAutomationType.FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION)
        .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
    AssetAutomationSetting.newBuilder()
        .setAssetAutomationType(AssetAutomationType.TEXT_ASSET_AUTOMATION)
        .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
    AssetAutomationSetting.newBuilder()
        .setAssetAutomationType(AssetAutomationType.GENERATE_ENHANCED_YOUTUBE_VIDEOS)
        .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build(),
    AssetAutomationSetting.newBuilder()
        .setAssetAutomationType(AssetAutomationType.GENERATE_IMAGE_ENHANCEMENT)
        .setAssetAutomationStatus(AssetAutomationStatus.OPTED_IN).build()))
      
```

### C#

```c#
campaign.AssetAutomationSettings.AddRange(new[]{
    new Campaign.Types.AssetAutomationSetting
    {
        AssetAutomationType = AssetAutomationType.GenerateImageExtraction,
        AssetAutomationStatus = AssetAutomationStatus.OptedIn
    },
    new Campaign.Types.AssetAutomationSetting
    {
        AssetAutomationType = AssetAutomationType.FinalUrlExpansionTextAssetAutomation,
        AssetAutomationStatus = AssetAutomationStatus.OptedIn
    },
    new Campaign.Types.AssetAutomationSetting
    {
        AssetAutomationType = AssetAutomationType.TextAssetAutomation,
        AssetAutomationStatus = AssetAutomationStatus.OptedIn
    },
    new Campaign.Types.AssetAutomationSetting
    {
        AssetAutomationType = AssetAutomationType.GenerateEnhancedYoutubeVideos,
        AssetAutomationStatus = AssetAutomationStatus.OptedIn
    },
    new Campaign.Types.AssetAutomationSetting
    {
        AssetAutomationType = AssetAutomationType.GenerateImageEnhancement,
        AssetAutomationStatus = AssetAutomationStatus.OptedIn
    },
});
      
```

### PHP

```php
'asset_automation_settings' => [
    new AssetAutomationSetting(
        [
        'asset_automation_type' => AssetAutomationType::TEXT_ASSET_AUTOMATION,
        'asset_automation_status' => AssetAutomationStatus::OPTED_IN
        ]
    ),
    new AssetAutomationSetting(
        [
        'asset_automation_type' => AssetAutomationType::URL_EXPANSION,
        'asset_automation_status' => AssetAutomationStatus::OPTED_IN
        ]
    )
],
      
```

### Python

```python
# Configures the optional opt-in/out status for asset automation settings.
for asset_automation_type_enum in [
    client.enums.AssetAutomationTypeEnum.GENERATE_IMAGE_EXTRACTION,
    client.enums.AssetAutomationTypeEnum.FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION,
    client.enums.AssetAutomationTypeEnum.TEXT_ASSET_AUTOMATION,
    client.enums.AssetAutomationTypeEnum.GENERATE_ENHANCED_YOUTUBE_VIDEOS,
    client.enums.AssetAutomationTypeEnum.GENERATE_IMAGE_ENHANCEMENT,
]:
    asset_automattion_setting: Campaign.AssetAutomationSetting = (
        client.get_type("Campaign").AssetAutomationSetting()
    )
    asset_automattion_setting.asset_automation_type = (
        asset_automation_type_enum
    )
    asset_automattion_setting.asset_automation_status = (
        client.enums.AssetAutomationStatusEnum.OPTED_IN
    )
    campaign.asset_automation_settings.append(asset_automattion_setting)
      
```

### Ruby

```ruby
# Configures the optional opt-in/out status for asset automation settings.
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
  aas.asset_automation_type = :GENERATE_IMAGE_EXTRACTION
  aas.asset_automation_status = :OPTED_IN
end
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
  aas.asset_automation_type = :FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION
  aas.asset_automation_status = :OPTED_IN
end
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
  aas.asset_automation_type = :TEXT_ASSET_AUTOMATION
  aas.asset_automation_status = :OPTED_IN
end
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
  aas.asset_automation_type = :GENERATE_ENHANCED_YOUTUBE_VIDEOS
  aas.asset_automation_status = :OPTED_IN
end
c.asset_automation_settings << client.resource.asset_automation_setting do |aas|
  aas.asset_automation_type = :GENERATE_IMAGE_ENHANCEMENT
  aas.asset_automation_status = :OPTED_IN
end
      
```

### Perl

```perl
# Configures the optional opt-in/out status for asset automation settings.
# When we create the campaign object, we set campaign->{assetAutomationSettings}
# equal to $asset_automation_settings.
my $asset_automation_settings = [];
my $asset_automation_types    = [
  GENERATE_IMAGE_EXTRACTION, FINAL_URL_EXPANSION_TEXT_ASSET_AUTOMATION,
  TEXT_ASSET_AUTOMATION,     GENERATE_ENHANCED_YOUTUBE_VIDEOS,
  GENERATE_IMAGE_ENHANCEMENT
];
foreach my $asset_automation_type (@$asset_automation_types) {
  push @$asset_automation_settings,
    Google::Ads::GoogleAds::V26::Resources::AssetAutomationSetting->new({
      assetAutomationStatus => OPTED_IN,
      assetAutomationType   => $asset_automation_type
    });
}
      
```

### curl

> [!NOTE]
> **Note:** While a direct REST code sample for this step isn't provided here, you can achieve this using a manual REST request.   
>
> Refer to the Google Ads API REST interface documentation and the method-specific reference pages. You will need to construct the JSON payload based on the proto definitions.   
>
> Key Resources:
>
> - [Using REST](https://developers.google.com/google-ads/api/rest/overview.md.txt)
> - [REST Interface Structure](https://developers.google.com/google-ads/api/rest/design/overview.md.txt)
> - [JSON Field Mappings](https://developers.google.com/google-ads/api/rest/design/json-mappings.md.txt)
> - Consult the [REST API Reference](https://developers.google.com/google-ads/api/reference/rpc/latest/overview) for the specific service and method.

<br />

## Ad-level asset automation settings

These configure an asset automation for a single ad.
Not all of them are available for every ad type: refer to the
[reference documentation](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt) for further details.

| Asset automation type | Supported ad types | Default |
|---|---|---|
| [GENERATE_ANIMATED_IMAGES_FROM_OTHER_ASSETS](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#generate_animated_images_from_other_assets) | DemandGenMultiAssetAd | Enabled (starting in v25) |
| [GENERATE_DESIGN_VERSIONS_FOR_IMAGES](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#generate_design_versions_for_images) | DemandGenMultiAssetAd | Enabled |
| [GENERATE_LANDING_PAGE_PREVIEW](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#generate_landing_page_preview) | DemandGenVideoResponsiveAd | Disabled |
| [GENERATE_LANDING_PAGE_TEXT](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#generate_landing_page_text) | DemandGenVideoResponsiveAd | Enabled (starting in v24) |
| [GENERATE_SHORTER_YOUTUBE_VIDEOS](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#generate_shorter_youtube_videos) | DemandGenVideoResponsiveAd | Enabled |
| [GENERATE_VERTICAL_YOUTUBE_VIDEOS](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#generate_vertical_youtube_videos) | DemandGenVideoResponsiveAd | Enabled |
| [GENERATE_VIDEOS_FROM_OTHER_ASSETS](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#generate_videos_from_other_assets) | DemandGenMultiAssetAd | Enabled |
| [OVERLAY_TEXT_ON_VIDEOS](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt#overlay_text_on_videos) | DemandGenVideoResponsiveAd | Enabled (starting in v26) |

## Text guidelines

Text guidelines allow you to refine brand messages for automatically generated
text assets in Performance Max and AI Max campaigns by specifying term
exclusions and messaging restrictions.

To use text guidelines, populate the
[`text_guidelines`](https://developers.google.com/google-ads/api/reference/rpc/v26/Campaign.md.txt#text_guidelines) field of the
[`Campaign`](https://developers.google.com/google-ads/api/reference/rpc/v26/Campaign.md.txt) resource:

- **Term exclusions**: Provide a list of exact words or phrases to be excluded from generated text assets. Each exclusion can be up to 30 characters, with a maximum of 25 exclusions.
- **Messaging restrictions** : Provide freeform instructions (up to 300 characters each) to guide AI text generation. You can provide up to 40 restrictions. Only [`RESTRICTION_BASED_EXCLUSION`](https://developers.google.com/google-ads/api/reference/rpc/v26/MessagingRestrictionTypeEnum.MessagingRestrictionType.md.txt#restriction_based_exclusion) is supported for the restriction type.

## Automated video crawl settings

Automated video crawling (available starting in v25, also known as sourced
videos) allows Google to discover and use relevant videos from approved sources
for Performance Max campaigns, helping improve ad performance without requiring
manual video uploads.

To use automated video crawling:

1. Set the [`asset_automation_type`](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationTypeEnum.AssetAutomationType.md.txt) to `AUTOMATED_VIDEO_CRAWL`.
2. Set the [`asset_automation_status`](https://developers.google.com/google-ads/api/reference/rpc/v26/AssetAutomationStatusEnum.AssetAutomationStatus.md.txt) to `OPTED_IN`.
3. Configure the
   [`automated_video_crawl_setting`](https://developers.google.com/google-ads/api/reference/rpc/v26/Campaign.AssetAutomationSetting.md.txt#automated_video_crawl_setting) field of
   [`AssetAutomationSetting`](https://developers.google.com/google-ads/api/reference/rpc/v26/Campaign.AssetAutomationSetting.md.txt) with one or more
   [`AutomatedVideoCrawlInfo`](https://developers.google.com/google-ads/api/reference/rpc/v26/Campaign.AssetAutomationSetting.AutomatedVideoCrawlInfo.md.txt) entries in
   `automated_video_crawl_infos`:

   - `url`: The URL to be included for crawling (such as your landing page, social profile, or YouTube channel).
   - `source_platform`: The [`VideoCrawlSourcePlatform`](https://developers.google.com/google-ads/api/reference/rpc/v26/VideoCrawlSourcePlatformEnum.VideoCrawlSourcePlatform.md.txt) representing the type of source:
     - `LANDING_PAGE`: Videos found on the advertiser's landing page.
     - `SOCIAL`: Organic social video URLs linked on the advertiser's landing page (Facebook, Instagram, X, LinkedIn, TikTok).
     - `YOUTUBE`: Videos from the advertiser's YouTube channel.
   - `enabled`: A boolean indicating whether this source URL is approved and enabled for crawling.

> [!NOTE]
> **Note:** By turning on automated video crawling, you confirm that you own all legal rights to the videos from the sources you enable and have permission to share them with Google for advertising purposes.