defcreate_multiple_text_assets(client:GoogleAdsClient,customer_id:str,texts:List[str])->List[str]:"""Creates multiple text assets and returns the list of resource names.Args:client: an initialized GoogleAdsClient instance.customer_id: a client customer ID.texts: a list of strings, each of which will be used to create a textasset.Returns:asset_resource_names: a list of asset resource names."""# Here again we use the GoogleAdService to create multiple text# assets in a single request.googleads_service:GoogleAdsServiceClient=client.get_service("GoogleAdsService")operations:List[MutateOperation]=[]fortextintexts:mutate_operation:MutateOperation=client.get_type("MutateOperation")asset:Asset=mutate_operation.asset_operation.createasset.text_asset.text=textoperations.append(mutate_operation)# Send the operations in a single Mutate request.response:MutateGoogleAdsResponse=googleads_service.mutate(customer_id=customer_id,mutate_operations=operations,)asset_resource_names:List[str]=[]forresultinresponse.mutate_operation_responses:ifresult._pb.HasField("asset_result"):asset_resource_names.append(result.asset_result.resource_name)print_response_details(response)returnasset_resource_names
# Creates multiple text assets and returns the list of resource names.defcreate_multiple_text_assets(client,customer_id,texts)operations=texts.mapdo|text|client.operation.mutatedo|m|m.asset_operation=client.operation.create_resource.assetdo|asset|asset.text_asset=client.resource.text_assetdo|text_asset|text_asset.text=textendendendend# Send the operations in a single Mutate request.response=client.service.google_ads.mutate(customer_id:customer_id,mutate_operations:operations,)asset_resource_names=[]response.mutate_operation_responses.eachdo|result|ifresult.asset_resultasset_resource_names.append(result.asset_result.resource_name)endendprint_response_details(response)asset_resource_namesend
subcreate_multiple_text_assets{my($api_client,$customer_id,$texts)=@_;# Here again we use the GoogleAdService to create multiple text assets in a# single request.my$operations=[];foreachmy$text(@$texts){# Create a mutate operation for a text asset.push@$operations,Google::Ads::GoogleAds::V21::Services::GoogleAdsService::MutateOperation->new({assetOperation=>Google::Ads::GoogleAds::V21::Services::AssetService::AssetOperation->new({create=>Google::Ads::GoogleAds::V21::Resources::Asset->new({textAsset=>Google::Ads::GoogleAds::V21::Common::TextAsset->new({text=>$text})})})});}# Issue a mutate request to add all assets.my$mutate_google_ads_response=$api_client->GoogleAdsService()->mutate({customerId=>$customer_id,mutateOperations=>$operations});my$asset_resource_names=[];foreachmy$response(@{$mutate_google_ads_response->{mutateOperationResponses}}){push@$asset_resource_names,$response->{assetResult}{resourceName};}print_response_details($mutate_google_ads_response);return$asset_resource_names;}
Google automation using machine learning generates additional assets as needed
to cover all relevant channels. Assets are automatically
mixed and matched based on which Google Ad channel (such as YouTube, Gmail, or
Search) your ad is being served on.
After you've associated a page feed, make sure theAssetAutomationSettingof typeTEXT_ASSET_AUTOMATIONis set toOPTED_IN.
This is the default setting if you didn't set theAssetAutomationSettingwhen
creating the campaign.
Using this setting means your campaign can use content from your landing page,
domain, and provided assets to customize ads when predicted to improve
performance. We recommend leaving this asOPTED-IN.
Video assets
If you don't add a video to your Performance Max asset group, then one or more
video assets might be generated from the assets in your asset group. If you no
longer want auto-generated videos to serve in your Performance Max campaign,
then you can upload your own custom video, and the auto-generated videos will
stop serving.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003ePerformance Max campaigns utilize \u003ccode\u003eAssetGroup\u003c/code\u003e to manage assets and require a minimum number of asset types.\u003c/p\u003e\n"],["\u003cp\u003eMachine learning can automatically generate some assets, such as videos and text assets based on linked page feeds.\u003c/p\u003e\n"],["\u003cp\u003eYou can reuse existing assets from other campaigns when upgrading to Performance Max.\u003c/p\u003e\n"],["\u003cp\u003eTo enable automatic text asset generation, link a page feed and ensure \u003ccode\u003eTEXT_ASSET_AUTOMATION\u003c/code\u003e is opted in.\u003c/p\u003e\n"],["\u003cp\u003eUploading a custom video will stop auto-generated videos from serving in your Performance Max campaign.\u003c/p\u003e\n"]]],[],null,[]]