실적 최대화 캠페인의 애셋

실적 최대화 캠페인에는 애셋과 관련하여 몇 가지 고유한 특징이 있습니다.

  1. 다양한 유형의 애셋에 필요한 최소 개수가 있습니다.
  2. 애셋은 실적 최대화 캠페인에만 있는 AssetGroup이라는 컬렉션으로 그룹화됩니다.
  3. 일부 확장 소재는 머신러닝을 통해 자동으로 생성될 수 있습니다.

브랜드 가이드라인: 비즈니스 이름 및 로고 연결

실적 최대화 캠페인의 대부분의 애셋은 애셋 그룹 내에 정리되지만 브랜드 가이드라인이 캠페인에 사용 설정된 경우 브랜드의 정체성을 나타내는 주요 애셋(특히 비즈니스 이름비즈니스 로고)은 다르게 처리됩니다.

이러한 브랜드 가이드라인 애셋은 애셋 그룹 수준이 아닌 캠페인 수준에서 직접 연결됩니다. 이 작업은 CampaignAsset 리소스를 사용하여 수행됩니다. 애셋을 캠페인에 연결하고 적절한 AssetFieldType을 지정합니다.

*   `BUSINESS_NAME` for the Business Name asset (which is a Text Asset).
*   `LOGO` for the Business Logo asset (which is an Image Asset).

이 캠페인 수준 연결을 통해 실적 최대화 캠페인 내의 모든 애셋 그룹에서 일관된 브랜드 표현이 보장됩니다.

코드 예

다음 코드 스니펫은 새 요청에서 필요한 반복 애셋을 만드는 방법을 보여줍니다.

자바

/** 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.V22.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;
}