效果最大化广告系列素材资源组由您在制作效果最大化广告系列时添加的图片、标题、广告内容描述和视频构成。为了优化广告的效果,系统会智能选择和组合您的素材资源,以便尽可能契合广告投放的特定 Google Ads 渠道(例如 YouTube、Gmail 或 Google 搜索)。
素材资源组无法在广告系列之间共享。每个广告系列都至少需要一个素材资源组。每个广告系列最多只能包含 100 个素材资源组。
素材资源组
素材资源组是以一个主题为中心或与一个目标受众群体相关的素材资源集合。素材资源组用于组合生成您的所有广告,并针对您的广告目标为所有适用的广告格式搭建广告资源。详细了解素材资源组。
素材资源组包含一个或多个最终到达网址。至少需要一个最终到达网址。
请使用与指定素材资源组和广告系列目标最相关的网址。您无法从 WEBPAGE
广告系列条件中排除素材资源组的最终到达网址。
将素材资源组与素材资源相关联
通过创建新的 AssetGroupAsset
并提供以下内容,将 AssetGroup
关联到 Asset
:
AssetGroup
的资源名称Asset
的资源名称AssetGroup
中的Asset
的AssetFieldType
一个 AssetGroup
可以关联到多个 Asset
对象。Asset
可以关联到多个素材资源组。一个 Asset
在不同的 AssetGroup
对象中可以具有不同的字段类型。
AssetGroup
操作必须是原子操作。不支持部分失败。无法在批量处理中修改素材资源组。
在效果最大化零售广告系列中将素材资源组与素材资源相关联
您无需满足最低素材资源要求,即可在效果最大化零售广告系列中制作 AssetGroup
对象。不过,如果在任何效果最大化广告系列中尝试使用 AssetGroupAsset
将 Asset
关联到 AssetGroup
,则会触发所有素材资源要求生效。换句话说,面向零售行业的效果最大化广告系列中的 AssetGroup
对象只能处于以下两种状态:
- 没有任何关联的
Asset
对象 - 满足所有
Asset
要求
我们建议的最佳做法是上传素材资源,以最大限度扩大覆盖所有广告资源的覆盖面。不过,您必须在单个请求中关联所有必需的素材资源,而不能通过单独的请求一次将素材资源添加到素材资源组。
Java
/** Creates a list of MutateOperations that create a new AssetGroup. */ private List<MutateOperation> createAssetGroupOperations( long customerId, String assetGroupResourceName, List<String> headlineAssetResourceNames, List<String> descriptionAssetResourceNames) throws IOException { List<MutateOperation> mutateOperations = new ArrayList<>(); String campaignResourceName = ResourceNames.campaign(customerId, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID); // Creates the AssetGroup. AssetGroup assetGroup = AssetGroup.newBuilder() .setName("Performance Max asset group #" + getPrintableDateTime()) .setCampaign(campaignResourceName) .addFinalUrls("http://www.example.com") .addFinalMobileUrls("http://www.example.com") .setStatus(AssetGroupStatus.PAUSED) .setResourceName(assetGroupResourceName) .build(); AssetGroupOperation assetGroupOperation = AssetGroupOperation.newBuilder().setCreate(assetGroup).build(); mutateOperations.add( MutateOperation.newBuilder().setAssetGroupOperation(assetGroupOperation).build()); // For the list of required assets for a Performance Max campaign, see // https://developers.google.com/google-ads/api/docs/performance-max/assets // An AssetGroup is linked to an Asset by creating a new AssetGroupAsset // and providing: // the resource name of the AssetGroup // the resource name of the Asset // the field_type of the Asset in this AssetGroup. // To learn more about AssetGroups, see // https://developers.google.com/google-ads/api/docs/performance-max/asset-groups // Links the previously created multiple text assets. // Links the headline assets. for (String resourceName : headlineAssetResourceNames) { AssetGroupAsset assetGroupAsset = AssetGroupAsset.newBuilder() .setFieldType(AssetFieldType.HEADLINE) .setAssetGroup(assetGroupResourceName) .setAsset(resourceName) .build(); AssetGroupAssetOperation assetGroupAssetOperation = AssetGroupAssetOperation.newBuilder().setCreate(assetGroupAsset).build(); mutateOperations.add( MutateOperation.newBuilder() .setAssetGroupAssetOperation(assetGroupAssetOperation) .build()); } // Links the description assets. for (String resourceName : descriptionAssetResourceNames) { AssetGroupAsset assetGroupAsset = AssetGroupAsset.newBuilder() .setFieldType(AssetFieldType.DESCRIPTION) .setAssetGroup(assetGroupResourceName) .setAsset(resourceName) .build(); AssetGroupAssetOperation assetGroupAssetOperation = AssetGroupAssetOperation.newBuilder().setCreate(assetGroupAsset).build(); mutateOperations.add( MutateOperation.newBuilder() .setAssetGroupAssetOperation(assetGroupAssetOperation) .build()); } // Creates and links the long headline text asset. List<MutateOperation> createAndLinkTextAssetOperations = createAndLinkTextAsset(customerId, "Travel the World", AssetFieldType.LONG_HEADLINE); mutateOperations.addAll(createAndLinkTextAssetOperations); // Creates and links the business name text asset. createAndLinkTextAssetOperations = createAndLinkTextAsset(customerId, "Interplanetary Cruises", AssetFieldType.BUSINESS_NAME); mutateOperations.addAll(createAndLinkTextAssetOperations); // Creates and links the image assets. // Creates and links the Logo Asset. createAndLinkTextAssetOperations = createAndLinkImageAsset( customerId, "https://gaagl.page.link/bjYi", AssetFieldType.LOGO, "Marketing Logo"); mutateOperations.addAll(createAndLinkTextAssetOperations); // Creates and links the Marketing Image Asset. createAndLinkTextAssetOperations = createAndLinkImageAsset( customerId, "https://gaagl.page.link/Eit5", AssetFieldType.MARKETING_IMAGE, "Marketing Image"); mutateOperations.addAll(createAndLinkTextAssetOperations); // Creates and links the Square Marketing Image Asset. createAndLinkTextAssetOperations = createAndLinkImageAsset( customerId, "https://gaagl.page.link/bjYi", AssetFieldType.SQUARE_MARKETING_IMAGE, "Square Marketing Image"); mutateOperations.addAll(createAndLinkTextAssetOperations); return mutateOperations; }
C#
/// <summary> /// Creates a list of MutateOperations that create a new asset_group. /// </summary> /// <param name="campaignResourceName">The campaign resource name.</param> /// <param name="assetGroupResourceName">The asset group resource name.</param> /// <param name="headlineAssetResourceNames">The headline asset resource names.</param> /// <param name="descriptionAssetResourceNames">The description asset resource /// names.</param> /// <param name="resourceNameGenerator">A generator for unique temporary ID's.</param> /// <param name="config">The Google Ads config.</param> /// <param name="brandGuidelinesEnabled">Whether or not to enable brand guidelines.</param> /// <returns>A list of MutateOperations that create the new asset group.</returns> private List<MutateOperation> CreateAssetGroupOperations( string campaignResourceName, string assetGroupResourceName, List<string> headlineAssetResourceNames, List<string> descriptionAssetResourceNames, AssetTemporaryResourceNameGenerator resourceNameGenerator, GoogleAdsConfig config, bool brandGuidelinesEnabled) { List<MutateOperation> operations = new List<MutateOperation>(); // Create the AssetGroup operations.Add( new MutateOperation() { AssetGroupOperation = new AssetGroupOperation() { Create = new AssetGroup() { Name = "Performance Max asset group #" + ExampleUtilities.GetRandomString(), Campaign = campaignResourceName, FinalUrls = { "http://www.example.com" }, FinalMobileUrls = { "http://www.example.com" }, Status = AssetGroupStatus.Paused, ResourceName = assetGroupResourceName } } } ); // For the list of required assets for a Performance Max campaign, see // https://developers.google.com/google-ads/api/docs/performance-max/assets // An AssetGroup is linked to an Asset by creating a new AssetGroupAsset // and providing: // the resource name of the AssetGroup // the resource name of the Asset // the field_type of the Asset in this AssetGroup. // // To learn more about AssetGroups, see // https://developers.google.com/google-ads/api/docs/performance-max/asset-groups // Link the previously created multiple text assets. // Link the headline assets. foreach (string resourceName in headlineAssetResourceNames) { operations.Add( new MutateOperation() { AssetGroupAssetOperation = new AssetGroupAssetOperation() { Create = new AssetGroupAsset() { FieldType = AssetFieldType.Headline, AssetGroup = assetGroupResourceName, Asset = resourceName } } } ); } // Link the description assets. foreach (string resourceName in descriptionAssetResourceNames) { operations.Add( new MutateOperation() { AssetGroupAssetOperation = new AssetGroupAssetOperation() { Create = new AssetGroupAsset() { FieldType = AssetFieldType.Description, AssetGroup = assetGroupResourceName, Asset = resourceName } } } ); } // Create and link the brand assets. operations.AddRange( CreateAndLinkBrandAssets( assetGroupResourceName, campaignResourceName, resourceNameGenerator, "Interplanetary Cruises", "https://gaagl.page.link/bjYi", "Marketing Logo", config, brandGuidelinesEnabled ) ); // Create and link the long headline text asset. operations.AddRange( CreateAndLinkTextAsset( assetGroupResourceName, resourceNameGenerator.Next(), "Travel the World", AssetFieldType.LongHeadline ) ); // Create and link the image assets. // Create and link the Marketing Image Asset. operations.AddRange( CreateAndLinkImageAsset( assetGroupResourceName, resourceNameGenerator.Next(), "https://gaagl.page.link/Eit5", AssetFieldType.MarketingImage, "Marketing Image", config ) ); // Create and link the Square Marketing Image Asset. operations.AddRange( CreateAndLinkImageAsset( assetGroupResourceName, resourceNameGenerator.Next(), "https://gaagl.page.link/bjYi", AssetFieldType.SquareMarketingImage, "Square Marketing Image", config ) ); return operations; }
PHP
private static function createAssetGroupOperations( int $customerId, array $headlineAssetResourceNames, array $descriptionAssetResourceNames ): array { $operations = []; // Creates a new mutate operation that creates an asset group operation. $operations[] = new MutateOperation([ 'asset_group_operation' => new AssetGroupOperation([ 'create' => new AssetGroup([ 'resource_name' => ResourceNames::forAssetGroup( $customerId, self::ASSET_GROUP_TEMPORARY_ID ), 'name' => 'Performance Max asset group #' . Helper::getPrintableDatetime(), 'campaign' => ResourceNames::forCampaign( $customerId, self::PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID ), 'final_urls' => ['http://www.example.com'], 'final_mobile_urls' => ['http://www.example.com'], 'status' => AssetGroupStatus::PAUSED ]) ]) ]); // For the list of required assets for a Performance Max campaign, see // https://developers.google.com/google-ads/api/docs/performance-max/assets // An AssetGroup is linked to an Asset by creating a new AssetGroupAsset // and providing: // - the resource name of the AssetGroup // - the resource name of the Asset // - the field_type of the Asset in this AssetGroup // // To learn more about AssetGroups, see // https://developers.google.com/google-ads/api/docs/performance-max/asset-groups. // Links the previously created multiple text assets. // Links the headline assets. foreach ($headlineAssetResourceNames as $resourceName) { $operations[] = new MutateOperation([ 'asset_group_asset_operation' => new AssetGroupAssetOperation([ 'create' => new AssetGroupAsset([ 'asset' => $resourceName, 'asset_group' => ResourceNames::forAssetGroup( $customerId, self::ASSET_GROUP_TEMPORARY_ID ), 'field_type' => AssetFieldType::HEADLINE ]) ]) ]); } // Links the description assets. foreach ($descriptionAssetResourceNames as $resourceName) { $operations[] = new MutateOperation([ 'asset_group_asset_operation' => new AssetGroupAssetOperation([ 'create' => new AssetGroupAsset([ 'asset' => $resourceName, 'asset_group' => ResourceNames::forAssetGroup( $customerId, self::ASSET_GROUP_TEMPORARY_ID ), 'field_type' => AssetFieldType::DESCRIPTION ]) ]) ]); } // Creates and links the long headline text asset. $operations = array_merge($operations, self::createAndLinkTextAsset( $customerId, 'Travel the World', AssetFieldType::LONG_HEADLINE )); // Creates and links the business name text asset. $operations = array_merge($operations, self::createAndLinkTextAsset( $customerId, 'Interplanetary Cruises', AssetFieldType::BUSINESS_NAME )); // Creates and links the image assets. // Creates and links the Logo Asset. $operations = array_merge($operations, self::createAndLinkImageAsset( $customerId, 'https://gaagl.page.link/bjYi', AssetFieldType::LOGO, 'Marketing Logo' )); // Creates and links the Marketing Image Asset. $operations = array_merge($operations, self::createAndLinkImageAsset( $customerId, 'https://gaagl.page.link/Eit5', AssetFieldType::MARKETING_IMAGE, 'Marketing Image' )); // Creates and links the Square Marketing Image Asset. $operations = array_merge($operations, self::createAndLinkImageAsset( $customerId, 'https://gaagl.page.link/bjYi', AssetFieldType::SQUARE_MARKETING_IMAGE, 'Square Marketing Image' )); return $operations; }
Python
def create_asset_group_operation( client, customer_id, headline_asset_resource_names, description_asset_resource_names, ): """Creates a list of MutateOperations that create a new asset_group. A temporary ID will be assigned to this asset group so that it can be referenced by other objects being created in the same Mutate request. Args: client: an initialized GoogleAdsClient instance. customer_id: a client customer ID. headline_asset_resource_names: a list of headline resource names. description_asset_resource_names: a list of description resource names. Returns: MutateOperations that create a new asset group and related assets. """ asset_group_service = client.get_service("AssetGroupService") campaign_service = client.get_service("CampaignService") operations = [] # Create the AssetGroup mutate_operation = client.get_type("MutateOperation") asset_group = mutate_operation.asset_group_operation.create asset_group.name = f"Performance Max asset group #{uuid4()}" asset_group.campaign = campaign_service.campaign_path( customer_id, _PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID ) asset_group.final_urls.append("http://www.example.com") asset_group.final_mobile_urls.append("http://www.example.com") asset_group.status = client.enums.AssetGroupStatusEnum.PAUSED asset_group.resource_name = asset_group_service.asset_group_path( customer_id, _ASSET_GROUP_TEMPORARY_ID, ) operations.append(mutate_operation) # For the list of required assets for a Performance Max campaign, see # https://developers.google.com/google-ads/api/docs/performance-max/assets # An AssetGroup is linked to an Asset by creating a new AssetGroupAsset # and providing: # the resource name of the AssetGroup # the resource name of the Asset # the field_type of the Asset in this AssetGroup. # # To learn more about AssetGroups, see # https://developers.google.com/google-ads/api/docs/performance-max/asset-groups # Link the previously created multiple text assets. # Link the headline assets. for resource_name in headline_asset_resource_names: mutate_operation = client.get_type("MutateOperation") asset_group_asset = mutate_operation.asset_group_asset_operation.create asset_group_asset.field_type = client.enums.AssetFieldTypeEnum.HEADLINE asset_group_asset.asset_group = asset_group_service.asset_group_path( customer_id, _ASSET_GROUP_TEMPORARY_ID, ) asset_group_asset.asset = resource_name operations.append(mutate_operation) # Link the description assets. for resource_name in description_asset_resource_names: mutate_operation = client.get_type("MutateOperation") asset_group_asset = mutate_operation.asset_group_asset_operation.create asset_group_asset.field_type = ( client.enums.AssetFieldTypeEnum.DESCRIPTION ) asset_group_asset.asset_group = asset_group_service.asset_group_path( customer_id, _ASSET_GROUP_TEMPORARY_ID, ) asset_group_asset.asset = resource_name operations.append(mutate_operation) # Create and link the long headline text asset. mutate_operations = create_and_link_text_asset( client, customer_id, "Travel the World", client.enums.AssetFieldTypeEnum.LONG_HEADLINE, ) operations.extend(mutate_operations) # Create and link the business name text asset. mutate_operations = create_and_link_text_asset( client, customer_id, "Interplanetary Cruises", client.enums.AssetFieldTypeEnum.BUSINESS_NAME, ) operations.extend(mutate_operations) # Create and link the image assets. # Create and link the Logo Asset. mutate_operations = create_and_link_image_asset( client, customer_id, "https://gaagl.page.link/bjYi", client.enums.AssetFieldTypeEnum.LOGO, "Marketing Logo", ) operations.extend(mutate_operations) # Create and link the Marketing Image Asset. mutate_operations = create_and_link_image_asset( client, customer_id, "https://gaagl.page.link/Eit5", client.enums.AssetFieldTypeEnum.MARKETING_IMAGE, "Marketing Image", ) operations.extend(mutate_operations) # Create and link the Square Marketing Image Asset. mutate_operations = create_and_link_image_asset( client, customer_id, "https://gaagl.page.link/bjYi", client.enums.AssetFieldTypeEnum.SQUARE_MARKETING_IMAGE, "Square Marketing Image", ) operations.extend(mutate_operations) return operations
Ruby
# Creates a list of MutateOperations that create a new asset_group. # # A temporary ID will be assigned to this asset group so that it can # be referenced by other objects being created in the same Mutate request. def create_asset_group_operation( client, customer_id, headline_asset_resource_names, description_asset_resource_names, brand_guidelines_enabled) operations = [] # Create the AssetGroup operations << client.operation.mutate do |m| m.asset_group_operation = client.operation.create_resource.asset_group do |ag| ag.name = "Performance Max asset group #{SecureRandom.uuid}" ag.campaign = client.path.campaign( customer_id, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID) ag.final_urls << "http://www.example.com" ag.final_mobile_urls << "http://www.example.com" ag.status = :PAUSED ag.resource_name = client.path.asset_group( customer_id, ASSET_GROUP_TEMPORARY_ID) end end # For the list of required assets for a Performance Max campaign, see # https://developers.google.com/google-ads/api/docs/performance-max/assets # # An AssetGroup is linked to an Asset by creating a new AssetGroupAsset # and providing: # the resource name of the AssetGroup # the resource name of the Asset # the field_type of the Asset in this AssetGroup. # # To learn more about AssetGroups, see # https://developers.google.com/google-ads/api/docs/performance-max/asset-groups # Link the previously created multiple text assets. # Link the headline assets. headline_asset_resource_names.each do |resource_name| operations << client.operation.mutate do |m| m.asset_group_asset_operation = client.operation.create_resource .asset_group_asset do |aga| aga.field_type = :HEADLINE aga.asset_group = client.path.asset_group( customer_id, ASSET_GROUP_TEMPORARY_ID) aga.asset = resource_name end end end # Link the description assets. description_asset_resource_names.each do |resource_name| operations << client.operation.mutate do |m| m.asset_group_asset_operation = client.operation.create_resource .asset_group_asset do |aga| aga.field_type = :DESCRIPTION aga.asset_group = client.path.asset_group( customer_id, ASSET_GROUP_TEMPORARY_ID) aga.asset = resource_name end end end # Create and link the long headline text asset. operations += create_and_link_text_asset( client, customer_id, "Travel the World", :LONG_HEADLINE) # Create and link the business name and logo asset. operations += create_and_link_brand_assets( client, customer_id, brand_guidelines_enabled, "Interplanetary Cruises", "https://gaagl.page.link/bjYi", "Marketing Logo") # Create and link the image assets. # Create and link the Marketing Image Asset. operations += create_and_link_image_asset( client, customer_id, "https://gaagl.page.link/Eit5", :MARKETING_IMAGE, "Marketing Image") # Create and link the Square Marketing Image Asset. operations += create_and_link_image_asset( client, customer_id, "https://gaagl.page.link/bjYi", :SQUARE_MARKETING_IMAGE, "Square Marketing Image") operations end
Perl
sub create_asset_group_operations { my ( $customer_id, $headline_asset_resource_names, $description_asset_resource_names ) = @_; my $operations = []; # Create a mutate operation that creates an asset group operation. push @$operations, Google::Ads::GoogleAds::V18::Services::GoogleAdsService::MutateOperation-> new({ assetGroupOperation => Google::Ads::GoogleAds::V18::Services::AssetGroupService::AssetGroupOperation ->new({ create => Google::Ads::GoogleAds::V18::Resources::AssetGroup->new({ resourceName => Google::Ads::GoogleAds::V18::Utils::ResourceNames::asset_group( $customer_id, ASSET_GROUP_TEMPORARY_ID ), name => "Performance Max asset group #" . uniqid(), campaign => Google::Ads::GoogleAds::V18::Utils::ResourceNames::campaign( $customer_id, PERFORMANCE_MAX_CAMPAIGN_TEMPORARY_ID ), finalUrls => ["http://www.example.com"], finalMobileUrls => ["http://www.example.com"], status => Google::Ads::GoogleAds::V18::Enums::AssetGroupStatusEnum::PAUSED })})}); # For the list of required assets for a Performance Max campaign, see # https://developers.google.com/google-ads/api/docs/performance-max/assets. # An AssetGroup is linked to an Asset by creating a new AssetGroupAsset # and providing: # - the resource name of the AssetGroup # - the resource name of the Asset # - the fieldType of the Asset in this AssetGroup # # To learn more about AssetGroups, see # https://developers.google.com/google-ads/api/docs/performance-max/asset-groups. # Link the previously created multiple text assets. # Link the headline assets. foreach my $resource_name (@$headline_asset_resource_names) { push @$operations, Google::Ads::GoogleAds::V18::Services::GoogleAdsService::MutateOperation ->new({ assetGroupAssetOperation => Google::Ads::GoogleAds::V18::Services::AssetGroupAssetService::AssetGroupAssetOperation ->new({ create => Google::Ads::GoogleAds::V18::Resources::AssetGroupAsset->new({ asset => $resource_name, assetGroup => Google::Ads::GoogleAds::V18::Utils::ResourceNames::asset_group( $customer_id, ASSET_GROUP_TEMPORARY_ID ), fieldType => HEADLINE })})}); } # Link the description assets. foreach my $resource_name (@$description_asset_resource_names) { push @$operations, Google::Ads::GoogleAds::V18::Services::GoogleAdsService::MutateOperation ->new({ assetGroupAssetOperation => Google::Ads::GoogleAds::V18::Services::AssetGroupAssetService::AssetGroupAssetOperation ->new({ create => Google::Ads::GoogleAds::V18::Resources::AssetGroupAsset->new({ asset => $resource_name, assetGroup => Google::Ads::GoogleAds::V18::Utils::ResourceNames::asset_group( $customer_id, ASSET_GROUP_TEMPORARY_ID ), fieldType => DESCRIPTION })})}); } # Create and link the long headline text asset. push @$operations, @{create_and_link_text_asset($customer_id, "Travel the World", LONG_HEADLINE)}; # Create and link the business name text asset. push @$operations, @{ create_and_link_text_asset($customer_id, "Interplanetary Cruises", BUSINESS_NAME)}; # Create and link the image assets. # Create and link the logo asset. push @$operations, @{ create_and_link_image_asset($customer_id, "https://gaagl.page.link/bjYi", LOGO, "Marketing Logo")}; # Create and link the marketing image asset. push @$operations, @{ create_and_link_image_asset( $customer_id, "https://gaagl.page.link/Eit5", MARKETING_IMAGE, "Marketing Image" )}; # Create and link the square marketing image asset. push @$operations, @{ create_and_link_image_asset( $customer_id, "https://gaagl.page.link/bjYi", SQUARE_MARKETING_IMAGE, "Square Marketing Image" )}; return $operations; }
预览素材资源组的广告
创建素材资源组并将素材资源与其相关联后,您可以生成可分享的预览,以显示使用每个素材资源组制作的广告的外观。
通过将素材资源组 ID 传递给 ShareablePreviewService.GenerateShareablePreviews,您可以检索要与用户分享的广告预览的网址及其到期时间戳。
多个素材资源组
如果素材资源不够通用,无法在网域中的多个网址中使用,并且您使用了网址扩展功能,则可以为不同的最终到达网址分别创建各自专属的素材资源组。
如果您希望按受众群体定制素材资源,也可以为同一最终到达网址创建多个素材资源组。您还可以为每个主题创建多个素材资源组。