Dynamic Search Ads Page Feeds

Stay organized with collections Save and categorize content based on your preferences.

By default, Dynamic Search Ads (DSAs) are set up to target entire websites, or portions of them without focusing on specific page URLs. If you need better control over the URLs, you can use DSA page feeds to specify precisely which URLs to use with your Dynamic Search Ads. When you provide a page feed of your products and their landing pages, it helps Google Ads determine when to show your ads and where to direct people on your website.

There are two options for creating page feeds.

  1. Asset-based page feeds. This is the preferred way to create page feeds.
  2. Feed-based page feeds. This is the legacy Feed route for creating page feeds.

This document covers both options.

Migration to asset-based DSA

Auto-migration process

Google will automatically migrate any existing DSA page feeds after April 27, 2022. We highly recommend manually migrating your accounts before then.

After migration, there will be no link between auto-migrated assets and the feed items they were based on (there are no common IDs). Additionally, your systems will need to handle both legacy and asset-based page feeds in the meantime.

After the auto-migration process has run on your accounts, write access will be blocked to the legacy feeds.

Hybrid serving

During the migration to asset-based DSA, your account will work in a hybrid mode. Both the legacy feeds and asset-based feeds will continue to serve. If a campaign has both an asset-based feed and a legacy feed, then both will serve during the migration.

Frequently Asked Questions

Will there be any gap in reporting statistics during the migration?

Gaps in statistics can be avoided if both the old and new page feeds are created with an overlap. Page feed statistics are keyed by the URL, not the feed/asset ID. To make sure no gaps are introduced, create the assets (and link an AssetSet) before removing the old feeds. The Google auto-migration won't produce gaps.

Will the old feeds be removed?

Yes, eventually the old feeds will be removed.

Can I update labels without re-creating the asset?

Yes, labels can be updated with a normal UPDATE operation on the asset. This does not affect reporting statistics which are always keyed by URL.

Asset-based workflow for creating DSA page feeds

Create assets for each page on your website

First, create an Asset for each URL on your website.

Java

List<String> urls =
    ImmutableList.of(
        "http://www.example.com/discounts/rental-cars",
        "http://www.example.com/discounts/hotel-deals",
        "http://www.example.com/discounts/flight-deals");

// Creates one operation per URL.
List<AssetOperation> assetOperations = new ArrayList<>();
for (String url : urls) {
  PageFeedAsset pageFeedAsset =
      PageFeedAsset.newBuilder()
          // Sets the URL of the page to include.
          .setPageUrl(url)
          // Recommended: adds labels to the asset. These labels can be used later in ad group
          // targeting to restrict the set of pages that can serve.
          .addLabels(dsaPageUrlLabel)
          .build();
  Asset asset = Asset.newBuilder().setPageFeedAsset(pageFeedAsset).build();
  assetOperations.add(AssetOperation.newBuilder().setCreate(asset).build());
}

// Creates the service client.
try (AssetServiceClient assetServiceClient =
    googleAdsClient.getLatestVersion().createAssetServiceClient()) {
  // Adds the assets.
  MutateAssetsResponse response =
      assetServiceClient.mutateAssets(String.valueOf(customerId), assetOperations);
  // Prints some information about the result.
  List<String> resourceNames =
      response.getResultsList().stream()
          .map(MutateAssetResult::getResourceName)
          .collect(Collectors.toList());
  resourceNames.forEach(r -> System.out.printf("Created asset with resource name %s.%n", r));
  return resourceNames;
}
      

C#

/// <summary>
/// Creates Assets to be used in a DSA page feed.
/// </summary>
/// <param name="client">The Google Ads client.</param>
/// <param name="customerId">The Google Ads customer ID for which the call is made.</param>
/// <param name="dsaPageUrlLabel">The DSA page URL label.</param>
/// <returns>The list of asset resource names.</returns>
private static List<string> CreateAssets(GoogleAdsClient client, long customerId,
    string dsaPageUrlLabel)
{
    AssetServiceClient assetService = client.GetService(Services.V12.AssetService);

    string[] urls = new[]
    {
        "http://www.example.com/discounts/rental-cars",
        "http://www.example.com/discounts/hotel-deals",
        "http://www.example.com/discounts/flight-deals"
    };

    // Creates one operation per URL.
    List<AssetOperation> assetOperations = new List<AssetOperation>();
    foreach (string url in urls)
    {
        PageFeedAsset pageFeedAsset = new PageFeedAsset()
        {
            // Sets the URL of the page to include.
            PageUrl = url,

            // Recommended: adds labels to the asset. These labels can be used later in
            // ad group targeting to restrict the set of pages that can serve.
            Labels = { dsaPageUrlLabel }
        };

        assetOperations.Add(
            new AssetOperation()
            {
                Create = new Asset()
                {
                    PageFeedAsset = pageFeedAsset
                }
            });
    }

    // Adds the assets.
    MutateAssetsResponse response =
        assetService.MutateAssets(customerId.ToString(), assetOperations);

    // Prints some information about the result.
    List<string> resourceNames = response.Results.Select(
        assetResult => assetResult.ResourceName).ToList();
    foreach (string resourceName in resourceNames)
    {
        Console.Write($"Created asset with resource name {resourceName}.");
    }
    return resourceNames;
}
      

PHP

$urls = [
    'http://www.example.com/discounts/rental-cars',
    'http://www.example.com/discounts/hotel-deals',
    'http://www.example.com/discounts/flight-deals'
];
$operations = [];
// Creates one asset per URL.
foreach ($urls as $url) {
    $pageFeedAsset = new PageFeedAsset([
        'page_url' => $url,
        // Recommended: adds labels to the asset. These labels can be used later in ad group
        // targeting to restrict the set of pages that can serve.
        'labels' => [$dsaPageUrlLabel]
    ]);

    // Wraps the page feed asset in an asset.
    $asset = new Asset(['page_feed_asset' => $pageFeedAsset]);

    // Creates an asset operation and adds it to the list of operations.
    $assetOperation = new AssetOperation();
    $assetOperation->setCreate($asset);
    $operations[] = $assetOperation;
}

// Issues a mutate request to add the assets and prints its information.
$assetServiceClient = $googleAdsClient->getAssetServiceClient();
$response = $assetServiceClient->mutateAssets(
    $customerId,
    $operations
);
$assetResourceNames = [];
printf("Added %d assets:%s", $response->getResults()->count(), PHP_EOL);
foreach ($response->getResults() as $addedAsset) {
    /** @var Asset $addedAsset */
    $assetResourceName = $addedAsset->getResourceName();
    printf(
        "Created an asset with resource name: '%s'.%s",
        $assetResourceName,
        PHP_EOL
    );
    $assetResourceNames[] = $assetResourceName;
}
return $assetResourceNames;
      

Python

This example is not yet available in Python; you can take a look at the other languages.
    

Ruby

def create_assets(client, dsa_page_url_label, customer_id)
  urls = [
    'http://www.example.com/discounts/rental-cars',
    'http://www.example.com/discounts/hotel-deals',
    'http://www.example.com/discounts/flight-deals',
  ]

  operations = urls.map do |url|
    client.operation.create_resource.asset do |asset|
      asset.page_feed_asset = client.resource.page_feed_asset do |pfa|
        # Sets the URL of the page to include.
        pfa.page_url = url
        # Recommended: adds labels to the asset. These labels can be used later
        # in ad group targeting to restrict the set of pages that can serve.
        pfa.labels << dsa_page_url_label
      end
    end
  end

  response = client.service.asset.mutate_assets(
    customer_id: customer_id,
    operations: operations,
  )

  resource_names = []
  response.results.each do |result|
    resource_name = result.resource_name
    puts "Created asset with resource name '#{resource_name}'"
    resource_names << resource_name
  end

  resource_names
end
      

Perl

my $urls = [
  "http://www.example.com/discounts/rental-cars",
  "http://www.example.com/discounts/hotel-deals",
  "http://www.example.com/discounts/flight-deals"
];

# Create one operation per URL.
my $asset_operations = [];
foreach my $url (@$urls) {
  my $page_feed_asset =
    Google::Ads::GoogleAds::V12::Common::PageFeedAsset->new({
      # Set the URL of the page to include.
      pageUrl => $url,
      # Recommended: add labels to the asset. These labels can be used later in
      # ad group targeting to restrict the set of pages that can serve.
      labels => [$dsa_page_url_label]});
  my $asset = Google::Ads::GoogleAds::V12::Resources::Asset->new({
    pageFeedAsset => $page_feed_asset
  });

  push @$asset_operations,
    Google::Ads::GoogleAds::V12::Services::AssetService::AssetOperation->new({
      create => $asset
    });
}

# Add the assets.
my $response = $api_client->AssetService()->mutate({
  customerId => $customer_id,
  operations => $asset_operations
});

# Print some information about the response.
my $resource_names = [];
foreach my $result (@{$response->{results}}) {
  push @$resource_names, $result->{resourceName};
  printf "Created asset with resource name '%s'.\n", $result->{resourceName};
}
return $resource_names;
      

Package page feed assets into an AssetSet

Next, create a collection of assets known as an AssetSet. This grouping represents all the URLs that should be considered for a particular campaign. An Asset can be in multiple AssetSet objects.

First, create a new AssetSet:

Java

// Creates an AssetSet which will be used to link the dynamic page feed assets to a campaign.
AssetSet assetSet =
    AssetSet.newBuilder()
        .setName("My dynamic page feed " + CodeSampleHelper.getPrintableDateTime())
        .setType(AssetSetType.PAGE_FEED)
        .build();
// Creates an operation to add the AssetSet.
AssetSetOperation operation = AssetSetOperation.newBuilder().setCreate(assetSet).build();
try (AssetSetServiceClient serviceClient =
    googleAdsClient.getLatestVersion().createAssetSetServiceClient()) {
  // Sends the mutate request.
  MutateAssetSetsResponse response =
      serviceClient.mutateAssetSets(
          String.valueOf(params.customerId), ImmutableList.of(operation));
  // Prints some information about the response.
  String resourceName = response.getResults(0).getResourceName();
  System.out.printf("Created asset set with resource name %s.%n", resourceName);
  return resourceName;
}
      

C#

/// <summary>
/// Creates an AssetSet.
/// </summary>
/// <param name="client">The Google Ads client.</param>
/// <param name="customerId">The Google Ads customer ID for which the call is made.</param>
/// <returns>The resource name of the asset set.</returns>
private string CreateAssetSet(GoogleAdsClient client, long customerId)
{
    AssetSetServiceClient assetSetService = client.GetService(
        Services.V12.AssetSetService);

    // Creates an AssetSet which will be used to link the dynamic page feed assets
    // to a campaign.
    AssetSet assetSet = new AssetSet()
    {
        Name = "My dynamic page feed " + ExampleUtilities.GetRandomString(),
        Type = AssetSetType.PageFeed
    };

    // Creates an operation to add the AssetSet.
    AssetSetOperation operation = new AssetSetOperation()
    {
        Create = assetSet
    };

    // Sends the mutate request.
    MutateAssetSetsResponse response =
        assetSetService.MutateAssetSets(
            customerId.ToString(), new[] { operation });
    // Prints some information about the response.
    string resourceName = response.Results[0].ResourceName;
    Console.WriteLine($"Created asset set with resource name {resourceName}.");
    return resourceName;
}
      

PHP

// Creates an asset set which will be used to link the dynamic page feed assets to a
// campaign.
$assetSet = new AssetSet([
    'name' => 'My dynamic page feed ' . Helper::getPrintableDatetime(),
    'type' => AssetSetType::PAGE_FEED
]);

// Creates an asset set operation.
$assetSetOperation = new AssetSetOperation();
$assetSetOperation->setCreate($assetSet);

// Issues a mutate request to add the asset set and prints its information.
$assetSetServiceClient = $googleAdsClient->getAssetSetServiceClient();
$response = $assetSetServiceClient->mutateAssetSets(
    $customerId,
    [$assetSetOperation]
);
$assetSetResourceName = $response->getResults()[0]->getResourceName();
printf(
    "Created an asset set with resource name: '%s'.%s",
    $assetSetResourceName,
    PHP_EOL
);

return $assetSetResourceName;
      

Python

This example is not yet available in Python; you can take a look at the other languages.
    

Ruby

def create_asset_set(client, customer_id)
  # Creates an AssetSet which will be used to link the dynamic page feed assets to a campaign.
  # Creates an operation to add the AssetSet.
  operation = client.operation.create_resource.asset_set do |asset_set|
    asset_set.name = "My dynamic page feed #{Time.now}"
    asset_set.type = :PAGE_FEED
  end

  # Sends the mutate request.
  response = client.service.asset_set.mutate_asset_sets(
    customer_id: customer_id,
    operations: [operation],
  )
  # Prints some information about the response.
  resource_name = response.results.first.resource_name
  puts "Created asset set with resource name '#{resource_name}'"

  resource_name
end
      

Perl

# Create an AssetSet which will be used to link the dynamic page feed assets to
# a campaign.
my $asset_set = Google::Ads::GoogleAds::V12::Resources::AssetSet->new({
  name => "My dynamic page feed #" . uniqid(),
  type => PAGE_FEED
});

# Create an operation to add the AssetSet.
my $operation =
  Google::Ads::GoogleAds::V12::Services::AssetSetService::AssetSetOperation->
  new({
    create => $asset_set
  });

# Send the mutate request.
my $response = $api_client->AssetSetService()->mutate({
    customerId => $customer_id,
    operations => [$operation]});

# Print some information about the response.
my $resource_name = $response->{results}[0]{resourceName};
printf "Created asset set with resource name '%s'.\n", $resource_name;
return $resource_name;
      

Then, create a link between your assets from above and the AssetSet:

Java

List<AssetSetAssetOperation> operations = new ArrayList<>();
for (String assetResourceName : assetResourceNames) {
  AssetSetAsset assetSetAsset =
      AssetSetAsset.newBuilder()
          .setAsset(assetResourceName)
          .setAssetSet(assetSetResourceName)
          .build();
  // Creates an operation to add the link.
  AssetSetAssetOperation operation =
      AssetSetAssetOperation.newBuilder().setCreate(assetSetAsset).build();
  operations.add(operation);
}
try (AssetSetAssetServiceClient client =
    googleAdsClient.getLatestVersion().createAssetSetAssetServiceClient()) {
  // Sends the mutate request.
  MutateAssetSetAssetsResponse response =
      client.mutateAssetSetAssets(String.valueOf(params.customerId), operations);
  // Prints some information about the response.
  String resourceName = response.getResults(0).getResourceName();
  System.out.printf("Created AssetSetAsset link with resource name %s.%n", resourceName);
}
      

C#

/// <summary>
/// Adds an Asset to an AssetSet by creating an AssetSetAsset link.
/// </summary>
/// <param name="client">The Google Ads client.</param>
/// <param name="customerId">The Google Ads customer ID for which the call is made.</param>
/// <param name="assetResourceNames">The asset resource names.</param>
/// <param name="assetSetResourceName">Resource name of the asset set.</param>
private void AddAssetsToAssetSet(GoogleAdsClient client, long customerId,
    List<string> assetResourceNames, string assetSetResourceName)
{
    AssetSetAssetServiceClient assetSetAssetService = client.GetService(
        Services.V12.AssetSetAssetService);

    List<AssetSetAssetOperation> operations = new List<AssetSetAssetOperation>();
    foreach (string assetResourceName in assetResourceNames)
    {
        AssetSetAsset assetSetAsset = new AssetSetAsset()
        {
            Asset = assetResourceName,
            AssetSet = assetSetResourceName
        };

        // Creates an operation to add the link.
        AssetSetAssetOperation operation = new AssetSetAssetOperation()
        {
            Create = assetSetAsset
        };

        operations.Add(operation);
    }
    // Sends the mutate request.
    MutateAssetSetAssetsResponse response =
        assetSetAssetService.MutateAssetSetAssets(customerId.ToString(), operations);
    // Prints some information about the response.
    string resourceName = response.Results[0].ResourceName;
    Console.WriteLine($"Created AssetSetAsset link with resource name {resourceName}.");
}
      

PHP

$operations = [];
foreach ($assetResourceNames as $assetResourceName) {
    // Creates an asset set asset.
    $assetSetAsset = new AssetSetAsset([
        'asset' => $assetResourceName,
        'asset_set' => $assetSetResourceName
    ]);

    // Creates an asset set asset operation and adds it to the list of operations.
    $assetSetAssetOperation = new AssetSetAssetOperation();
    $assetSetAssetOperation->setCreate($assetSetAsset);
    $operations[] = $assetSetAssetOperation;
}

// Issues a mutate request to add the asset set assets and prints its information.
$assetSetAssetServiceClient = $googleAdsClient->getAssetSetAssetServiceClient();
$response = $assetSetAssetServiceClient->mutateAssetSetAssets(
    $customerId,
    $operations
);
printf("Added %d asset set assets:%s", $response->getResults()->count(), PHP_EOL);
foreach ($response->getResults() as $addedAssetSetAsset) {
    /** @var AssetSetAsset $addedAssetSetAsset */
    printf(
        "Created an asset set asset link with resource name: '%s'.%s",
        $addedAssetSetAsset->getResourceName(),
        PHP_EOL
    );
}
      

Python

This example is not yet available in Python; you can take a look at the other languages.
    

Ruby

def add_assets_to_asset_set(client, asset_resource_names, asset_set_resource_name, customer_id)
  operations = asset_resource_names.map do |asset_resource_name|
    client.operation.create_resource.asset_set_asset do |asa|
      asa.asset = asset_resource_name
      asa.asset_set = asset_set_resource_name
    end
  end

  response = client.service.asset_set_asset.mutate_asset_set_assets(
    customer_id: customer_id,
    operations: operations,
  )
  resource_name = response.results.first.resource_name
  puts "Created asset set asset with resource name '#{resource_name}'"
end
      

Perl

my $operations = [];
foreach my $asset_resource_name (@$asset_resource_names) {
  my $asset_set_asset =
    Google::Ads::GoogleAds::V12::Resources::AssetSetAsset->new({
      asset    => $asset_resource_name,
      assetSet => $asset_set_resource_name
    });

  # Create an operation to add the link.
  my $operation =
    Google::Ads::GoogleAds::V12::Services::AssetSetAssetService::AssetSetAssetOperation
    ->new({
      create => $asset_set_asset
    });
  push @$operations, $operation;
}

# Send the mutate request.
my $response = $api_client->AssetSetAssetService()->mutate({
  customerId => $customer_id,
  operations => $operations
});

# Print some information about the response.
my $resource_name = $response->{results}[0]{resourceName};
printf "Created AssetSetAsset link with resource name '%s'.\n",
  $resource_name;
      

Associate the AssetSet with a campaign

Once assets are collected in an AssetSet, associate the PageFeedAsset with a campaign.

Java

// Creates a CampaignAssetSet representing the link between an AssetSet and a Campaign.
CampaignAssetSet campaignAssetSet =
    CampaignAssetSet.newBuilder()
        .setCampaign(ResourceNames.campaign(params.customerId, params.campaignId))
        .setAssetSet(assetSetResourceName)
        .build();
// Creates an operation to add the CampaignAssetSet.
CampaignAssetSetOperation operation =
    CampaignAssetSetOperation.newBuilder().setCreate(campaignAssetSet).build();
// Creates the service client.
try (CampaignAssetSetServiceClient client =
    googleAdsClient.getLatestVersion().createCampaignAssetSetServiceClient()) {
  // Issues the mutate request.
  MutateCampaignAssetSetsResponse response =
      client.mutateCampaignAssetSets(
          String.valueOf(params.customerId), ImmutableList.of(operation));
  String resourceName = response.getResults(0).getResourceName();
  System.out.printf("Created a CampaignAssetSet with resource name %s.%n", resourceName);
}
      

C#

/// <summary>
/// Links an AssetSet to a Campaign by creating a CampaignAssetSet.
/// </summary>
/// <param name="client">The Google Ads client.</param>
/// <param name="customerId">The Google Ads customer ID for which the call is made.</param>
/// <param name="campaignId">ID of the campaign to which the asset is linked.</param>
/// <param name="assetSetResourceName">Resource name of the asset set.</param>
private void LinkAssetSetToCampaign(GoogleAdsClient client, long customerId,
    long campaignId, string assetSetResourceName)
{
    CampaignAssetSetServiceClient campaignAssetSetService = client.GetService(
        Services.V12.CampaignAssetSetService);

    // Creates a CampaignAssetSet representing the link between an AssetSet and a Campaign.
    CampaignAssetSet campaignAssetSet = new CampaignAssetSet()
    {
        Campaign = ResourceNames.Campaign(customerId, campaignId),
        AssetSet = assetSetResourceName,
    };

    // Creates an operation to add the CampaignAssetSet.
    CampaignAssetSetOperation operation = new CampaignAssetSetOperation()
    {
        Create = campaignAssetSet
    };
    // Issues the mutate request.
    MutateCampaignAssetSetsResponse response =
        campaignAssetSetService.MutateCampaignAssetSets(
            customerId.ToString(), new[] { operation });
    string resourceName = response.Results[0].ResourceName;
    Console.WriteLine($"Created a CampaignAssetSet with resource name {resourceName}.");
}
      

PHP

// Creates a campaign asset set representing the link between an asset set and a campaign.
$campaignAssetSet = new CampaignAssetSet([
    'asset_set' => $assetSetResourceName,
    'campaign' => ResourceNames::forCampaign($customerId, $campaignId)
]);

// Creates a campaign asset set operation.
$campaignAssetSetOperation = new CampaignAssetSetOperation();
$campaignAssetSetOperation->setCreate($campaignAssetSet);

// Issues a mutate request to add the campaign asset set and prints its information.
$campaignAssetSetServiceClient = $googleAdsClient->getCampaignAssetSetServiceClient();
$response = $campaignAssetSetServiceClient->mutateCampaignAssetSets(
    $customerId,
    [$campaignAssetSetOperation]
);
printf(
    "Created a campaign asset set with resource name: '%s'.%s",
    $response->getResults()[0]->getResourceName(),
    PHP_EOL
);
      

Python

This example is not yet available in Python; you can take a look at the other languages.
    

Ruby

def link_asset_set_to_campaign(client, asset_set_resource_name, customer_id, campaign_id)
  # Creates a CampaignAssetSet representing the link between an AssetSet and a Campaign.
  # Creates an operation to add the CampaignAssetSet.
  operation = client.operation.create_resource.campaign_asset_set do |cas|
    cas.campaign = client.path.campaign(customer_id, campaign_id)
    cas.asset_set = asset_set_resource_name
  end

  # Issues the mutate request.
  response = client.service.campaign_asset_set.mutate_campaign_asset_sets(
    customer_id: customer_id,
    operations: [operation],
  )
  resource_name = response.results.first.resource_name
  puts "Created a campaign asset set with resource name '#{resource_name}'"
end
      

Perl

# Create a CampaignAssetSet representing the link between an AssetSet and a Campaign.
my $campaign_asset_set =
  Google::Ads::GoogleAds::V12::Resources::CampaignAssetSet->new({
    campaign => Google::Ads::GoogleAds::V12::Utils::ResourceNames::campaign(
      $customer_id, $campaign_id
    ),
    assetSet => $asset_set_resource_name
  });

# Create an operation to add the CampaignAssetSet.
my $operation =
  Google::Ads::GoogleAds::V12::Services::CampaignAssetSetService::CampaignAssetSetOperation
  ->new({
    create => $campaign_asset_set
  });

# Issue the mutate request.
my $response = $api_client->CampaignAssetSetService()->mutate({
    customerId => $customer_id,
    operations => [$operation]});

# Print some information about the response.
my $resource_name = $response->{results}[0]{resourceName};
printf "Created a CampaignAssetSet with resource name '%s'.\n",
  $resource_name;
      

You can optionally use custom labels to target and bid on URLs in the page feed. This can be done by creating a criterion based on a WebpageInfo that filters using a condition that has its operand set as WebpageConditionOperand.CUSTOM_LABEL.

Legacy: Feed services-based workflow for creating DSA page feeds

To set up a DSA page feed with Feed services:

  1. Create a feed and populate it with page URLs.
  2. Set up the campaign to use the DSA page feed.
  3. Optional, but recommended: Add custom labels to the URLs in your page feed to categorize and organize the targets for your Dynamic Search Ads.

Create a page feed (legacy)

The first step in using DSA page feeds is to create a feed with the field criterion_type of the FeedMapping set as DSA_PAGE_FEED. The procedure is similar to that listed in our feed services guide, except for the following differences.

  1. DSA page feeds use the criterion_type field instead of the placeholder_type field to set the target of the FeedMapping.
  2. You only need to create the feed, populate the items, and map the feed to the DSA page feed criterion fields.
DsaPageFeedCriterionField Description Required? Data Type
PAGE_URL URL of the web page you want to target. Yes URL or URL_LIST
LABEL The labels that will help you target ads within your page feed.

It should not contain the following string patterns: *, >>, ==, &+.

No STRING_LIST

Set up the campaign for page feeds (legacy)

You can set up a DSA campaign to use page feeds by setting the feeds field of its DynamicSearchAdsSetting.

Start by retrieving the DynamicSearchAdSetting for your Dynamic Search Ad campaign.

Next, set the page feeds by specifying their resource names in the feeds field of your campaign's DynamicSearchAdsSetting. You can optionally use the use_supplied_urls_only field to specify whether or not to use only the specified URLs for your Dynamic Search Ads.

These settings map to the Google Ads UI as follows.

use_supplied_urls_only feeds Google Ads UI Setting
false N/A Use Google's index of my website.
false One or more are specified. Use URLs from both Google’s index of my website and my page feed.
true One or more are specified. Use URLs from my page feed only.
true Empty or null. Not supported. The Google Ads API throws a SettingError.DYNAMIC_SEARCH_ADS_SETTING_AT_LEAST_ONE_FEED_ID_MUST_BE_PRESENT.