실적 최대화 캠페인은 확장 소재와 관련하여 몇 가지 고유한 특성을 가지고 있습니다.
- 다양한 유형의 저작물에 필요한 최소 개수가 있습니다.
- 확장 소재는 실적 최대화 캠페인에만 있는
AssetGroup
라는 컬렉션으로 그룹화됩니다. - 일부 확장 소재는 머신러닝에 의해 자동으로 생성될 수 있습니다.
코드 예
다음 코드 스니펫은 새 요청에서 필요한 반복 애셋을 만드는 방법을 보여줍니다.
자바
/** Creates multiple text assets and returns the list of resource names. */ private List<String> createMultipleTextAssets( GoogleAdsClient googleAdsClient, long customerId, List<String> texts) { List<MutateOperation> mutateOperations = new ArrayList<>(); for (String text : texts) { Asset asset = Asset.newBuilder().setTextAsset(TextAsset.newBuilder().setText(text)).build(); AssetOperation assetOperation = AssetOperation.newBuilder().setCreate(asset).build(); mutateOperations.add(MutateOperation.newBuilder().setAssetOperation(assetOperation).build()); } List<String> assetResourceNames = new ArrayList<>(); // Creates the service client. try (GoogleAdsServiceClient googleAdsServiceClient = googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) { // Sends the operations in a single Mutate request. MutateGoogleAdsResponse response = googleAdsServiceClient.mutate(Long.toString(customerId), mutateOperations); for (MutateOperationResponse result : response.getMutateOperationResponsesList()) { if (result.hasAssetResult()) { assetResourceNames.add(result.getAssetResult().getResourceName()); } } printResponseDetails(response); } return assetResourceNames; }
C#
/// <summary> /// Creates multiple text assets and returns the list of resource names. /// </summary> /// <param name="client">The Google Ads Client.</param> /// <param name="customerId">The customer's ID.</param> /// <param name="texts">The texts to add.</param> /// <returns>A list of asset resource names.</returns> private List<string> CreateMultipleTextAssets( GoogleAdsClient client, long customerId, string[] texts) { // Get the GoogleAdsService. GoogleAdsServiceClient googleAdsServiceClient = client.GetService(Services.V19.GoogleAdsService); MutateGoogleAdsRequest request = new MutateGoogleAdsRequest() { CustomerId = customerId.ToString() }; foreach (string text in texts) { request.MutateOperations.Add( new MutateOperation() { AssetOperation = new AssetOperation() { Create = new Asset() { TextAsset = new TextAsset() { Text = text } } } } ); } // Send the operations in a single Mutate request. MutateGoogleAdsResponse response = googleAdsServiceClient.Mutate(request); List<string> assetResourceNames = new List<string>(); foreach (MutateOperationResponse operationResponse in response.MutateOperationResponses) { MutateAssetResult assetResult = operationResponse.AssetResult; assetResourceNames.Add(assetResult.ResourceName); } PrintResponseDetails(response); return assetResourceNames; }
PHP
private static function createMultipleTextAssets( GoogleAdsClient $googleAdsClient, int $customerId, array $texts ): array { // Here again, we use the GoogleAdService to create multiple text assets in a single // request. $operations = []; foreach ($texts as $text) { // Creates a mutate operation for a text asset. $operations[] = new MutateOperation([ 'asset_operation' => new AssetOperation([ 'create' => new Asset(['text_asset' => new TextAsset(['text' => $text])]) ]) ]); } // Issues a mutate request to add all assets. $googleAdsService = $googleAdsClient->getGoogleAdsServiceClient(); /** @var MutateGoogleAdsResponse $mutateGoogleAdsResponse */ $mutateGoogleAdsResponse = $googleAdsService->mutate(MutateGoogleAdsRequest::build($customerId, $operations)); $assetResourceNames = []; foreach ($mutateGoogleAdsResponse->getMutateOperationResponses() as $response) { /** @var MutateOperationResponse $response */ $assetResourceNames[] = $response->getAssetResult()->getResourceName(); } self::printResponseDetails($mutateGoogleAdsResponse); return $assetResourceNames; }
Python
def create_multiple_text_assets(client, customer_id, texts): """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 text asset. 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 = client.get_service("GoogleAdsService") operations = [] for text in texts: mutate_operation = client.get_type("MutateOperation") asset = mutate_operation.asset_operation.create asset.text_asset.text = text operations.append(mutate_operation) # Send the operations in a single Mutate request. response = googleads_service.mutate( customer_id=customer_id, mutate_operations=operations, ) asset_resource_names = [] for result in response.mutate_operation_responses: if result._pb.HasField("asset_result"): asset_resource_names.append(result.asset_result.resource_name) print_response_details(response) return asset_resource_names
Ruby
# Creates multiple text assets and returns the list of resource names. def create_multiple_text_assets(client, customer_id, texts) operations = texts.map do |text| client.operation.mutate do |m| m.asset_operation = client.operation.create_resource.asset do |asset| asset.text_asset = client.resource.text_asset do |text_asset| text_asset.text = text end end end end # 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.each do |result| if result.asset_result asset_resource_names.append(result.asset_result.resource_name) end end print_response_details(response) asset_resource_names end
Perl
sub create_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 = []; foreach my $text (@$texts) { # Create a mutate operation for a text asset. push @$operations, Google::Ads::GoogleAds::V18::Services::GoogleAdsService::MutateOperation ->new({ assetOperation => Google::Ads::GoogleAds::V18::Services::AssetService::AssetOperation-> new({ create => Google::Ads::GoogleAds::V18::Resources::Asset->new({ textAsset => Google::Ads::GoogleAds::V18::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 = []; foreach my $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 자동화는 필요한 경우 모든 관련 채널을 포함하도록 추가 확장 소재를 생성합니다. 애셋은 광고가 게재되는 Google 광고 채널 (예: YouTube, Gmail, Google 검색)에 따라 자동으로 조합됩니다.
텍스트 애셋
계정의 페이지 피드를 실적 최대화 캠페인과 연결하여 확장 소재를 자동으로 생성할 수 있습니다.
페이지 피드를 캠페인에 연결하려면 동적 검색 광고에 사용한 것과 동일한 프로세스를 따르세요.
페이지 피드를 연결한 후 TEXT_ASSET_AUTOMATION
유형의 AssetAutomationSetting
이 OPTED_IN
로 설정되어 있는지 확인합니다.
캠페인을 만들 때 AssetAutomationSetting
를 설정하지 않은 경우 기본 설정입니다.
이 설정을 사용하면 실적 개선의 가능성이 있을 때 캠페인에서 방문 페이지, 도메인, 제공된 확장 소재의 콘텐츠를 사용하여 광고를 맞춤설정할 수 있습니다. 이 값은 OPTED-IN
로 두는 것이 좋습니다.
동영상 애셋
실적 최대화 캠페인의 애셋 그룹에 동영상을 추가하지 않으면 애셋 그룹에 포함된 애셋을 이용해 하나 이상의 동영상 확장 소재가 생성될 수 있습니다. 자동 생성 동영상이 실적 최대화 캠페인에 게재되지 않도록 하려면 맞춤 동영상을 업로드하세요. 그러면 자동으로 생성된 동영상의 게재가 중지됩니다.
스마트 자동화는 동영상 방향을 조정하고 동영상을 지능적으로 자르면서 주요 순간을 강조하여 YouTube 동영상 저작물을 개선할 수 있습니다. 원본 동영상 저작물을 유지하려면 GENERATE_ENHANCED_YOUTUBE_VIDEOS
유형의 AssetAutomationSetting
을 OPTED_OUT
로 설정하세요.