คะแนนการเพิ่มประสิทธิภาพและคำแนะนำ

วิดีโอ: ข้อมูลเจาะลึก

คำแนะนำช่วยปรับปรุงแคมเปญได้ 3 วิธีดังนี้

  • แนะนำฟีเจอร์ใหม่ที่เกี่ยวข้อง
  • ใช้งบประมาณได้คุ้มค่ามากขึ้นด้วยราคาเสนอ คีย์เวิร์ด และโฆษณาที่ปรับปรุงแล้ว
  • เพิ่มประสิทธิภาพและประสิทธิผลโดยรวมของแคมเปญ

หากต้องการเพิ่มคะแนนการเพิ่มประสิทธิภาพ ให้ใช้RecommendationService เพื่อเรียกดูคำแนะนำ จากนั้นจึงใช้หรือปิดคำแนะนำตามความเหมาะสม ตั้งแต่ Google Ads API เวอร์ชัน 15 เป็นต้นไป คุณสมัครรับคำแนะนำใช้โดยอัตโนมัติได้โดยใช้ RecommendationSubscriptionService

คะแนนการเพิ่มประสิทธิภาพ

วิดีโอ: คะแนนการเพิ่มประสิทธิภาพ

คะแนนการเพิ่มประสิทธิภาพคือค่าประมาณว่าบัญชี Google Ads มีความพร้อมในการทำงานดีเพียงใดและใช้งานได้ในระดับ Customer และ Campaign

Customer.optimization_score_weight ใช้ได้กับบัญชีที่ไม่ใช่บัญชีดูแลจัดการเท่านั้น และใช้ในการคำนวณคะแนนการเพิ่มประสิทธิภาพโดยรวมของหลายบัญชี ดึงข้อมูลน้ำหนักของคะแนนการเพิ่มประสิทธิภาพและคะแนนการเพิ่มประสิทธิภาพของบัญชี แล้วนำมารวมกัน (Customer.optimization_score * Customer.optimization_score_weight) เพื่อคำนวณคะแนนการเพิ่มประสิทธิภาพโดยรวม

มีเมตริกที่เกี่ยวข้องกับการเพิ่มประสิทธิภาพสำหรับรายงาน customer และ campaign ดังนี้

  1. metrics.optimization_score_url ให้ Deep Link ที่ใช้เข้าสู่ระบบบัญชีเพื่อดูข้อมูลเกี่ยวกับคำแนะนำที่เกี่ยวข้องใน UI ของ Google Ads
  2. metrics.optimization_score_uplift จะบอกจำนวนคะแนนการเพิ่มประสิทธิภาพที่เพิ่มขึ้นหากใช้คำแนะนำที่เกี่ยวข้องทั้งหมด ซึ่งเป็นค่าประมาณตามคำแนะนำทั้งหมดที่มีในภาพรวม ไม่ใช่แค่ผลรวมของคะแนนที่เพิ่มขึ้นของคำแนะนำแต่ละรายการ

หากต้องการจัดกลุ่มและเรียงลำดับคำแนะนำที่แสดงกลับมา คุณแบ่งกลุ่มเมตริกทั้ง 2 รายการนี้ตามประเภทคำแนะนำได้โดยใช้ segments.recommendation_type ในการค้นหา

ประเภทของการแนะนำ

ประเภทคำแนะนำที่รองรับเต็มรูปแบบ

RecommendationType คำอธิบาย
CAMPAIGN_BUDGET แก้ไขแคมเปญที่ถูกจำกัดด้วยงบประมาณ
KEYWORD เพิ่มคีย์เวิร์ดใหม่
TEXT_AD เพิ่มคำแนะนำโฆษณา
TARGET_CPA_OPT_IN เสนอราคาด้วย CPA เป้าหมาย
MAXIMIZE_CONVERSIONS_OPT_IN เสนอราคาด้วยการเพิ่มจำนวน Conversion สูงสุด
MAXIMIZE_CONVERSION_VALUE_OPT_IN เสนอราคาโดยเพิ่มมูลค่า Conversion สูงสุด
ENHANCED_CPC_OPT_IN เสนอราคาด้วย CPC ที่ปรับปรุงแล้ว
MAXIMIZE_CLICKS_OPT_IN เสนอราคาแบบเพิ่มจำนวนคลิกสูงสุด
OPTIMIZE_AD_ROTATION ใช้การหมุนเวียนโฆษณาที่เพิ่มประสิทธิภาพ
MOVE_UNUSED_BUDGET โอนส่วนที่ไม่ได้ใช้ไปยังงบประมาณที่จํากัด
TARGET_ROAS_OPT_IN เสนอราคาด้วย ROAS เป้าหมาย
FORECASTING_CAMPAIGN_BUDGET แก้ไขแคมเปญที่คาดว่าจะถูกจำกัดโดยงบประมาณในอนาคต
RESPONSIVE_SEARCH_AD เพิ่มโฆษณา Search ที่ปรับเปลี่ยนตามบริบทใหม่
MARGINAL_ROI_CAMPAIGN_BUDGET ปรับงบประมาณแคมเปญเพื่อเพิ่ม ROI
USE_BROAD_MATCH_KEYWORD ใช้การทำงานแบบกว้างสำหรับแคมเปญที่อิงตาม Conversion ที่มีการเสนอราคาอัตโนมัติ
RESPONSIVE_SEARCH_AD_ASSET เพิ่มชิ้นงานโฆษณา Search ที่ปรับเปลี่ยนตามบริบทลงในโฆษณา
RESPONSIVE_SEARCH_AD_IMPROVE_AD_STRENGTH ปรับปรุงคุณภาพของโฆษณา Search ที่ปรับเปลี่ยนตามบริบท
DISPLAY_EXPANSION_OPT_IN อัปเดตแคมเปญเพื่อใช้การขยายไปยังเครือข่าย Display
SEARCH_PARTNERS_OPT_IN ขยายการเข้าถึงด้วยพาร์ทเนอร์ในเครือข่าย Google Search
CUSTOM_AUDIENCE_OPT_IN สร้างกลุ่มเป้าหมายที่กำหนดเอง
IMPROVE_DISCOVERY_AD_STRENGTH ปรับปรุงคุณภาพของโฆษณาในแคมเปญ Demand Gen
UPGRADE_SMART_SHOPPING_CAMPAIGN_TO_PERFORMANCE_MAX อัปเกรดแคมเปญ Smart Shopping เป็นแคมเปญ Performance Max
UPGRADE_LOCAL_CAMPAIGN_TO_PERFORMANCE_MAX อัปเกรดแคมเปญในพื้นที่เดิมเป็นแคมเปญ Performance Max
SHOPPING_MIGRATE_REGULAR_SHOPPING_CAMPAIGN_OFFERS_TO_PERFORMANCE_MAX ย้ายข้อมูลข้อเสนอที่กำหนดเป้าหมายโดยแคมเปญ Shopping ปกติไปยังแคมเปญ Performance Max ที่มีอยู่
MIGRATE_DYNAMIC_SEARCH_ADS_CAMPAIGN_TO_PERFORMANCE_MAX ย้ายข้อมูลโฆษณา Search แบบไดนามิกไปยังแคมเปญ Performance Max
PERFORMANCE_MAX_OPT_IN สร้างแคมเปญ Performance Max ในบัญชี
IMPROVE_PERFORMANCE_MAX_AD_STRENGTH ปรับปรุงคุณภาพของกลุ่มชิ้นงานของแคมเปญ Performance Max เป็น คะแนน "ดีมาก"
PERFORMANCE_MAX_FINAL_URL_OPT_IN เปิด Final URL Expansion สําหรับแคมเปญ Performance Max
RAISE_TARGET_CPA_BID_TOO_LOW เพิ่ม CPA เป้าหมายเมื่อต่ำเกินไปและมี Conversion น้อยมากหรือไม่มีเลย
FORECASTING_SET_TARGET_ROAS เพิ่มงบประมาณล่วงหน้าก่อนถึงเทศกาลประจำปีที่คาดการณ์ว่าจะเพิ่มการเข้าชม และเปลี่ยนกลยุทธ์การเสนอราคาจากการเพิ่มมูลค่า Conversion สูงสุดเป็น ROAS เป้าหมาย
LEAD_FORM เพิ่มชิ้นงานโฆษณาแบบกรอกฟอร์มลงในแคมเปญ
CALLOUT_ASSET เพิ่มชิ้นงานข้อความไฮไลต์ลงในแคมเปญหรือระดับลูกค้า
SITELINK_ASSET เพิ่มชิ้นงานไซต์ลิงก์ลงในแคมเปญหรือระดับลูกค้า
CALL_ASSET เพิ่มชิ้นงานการโทรลงในแคมเปญหรือระดับลูกค้า
SHOPPING_ADD_AGE_GROUP เพิ่มแอตทริบิวต์กลุ่มอายุไปยังข้อเสนอที่ถูกลดระดับเนื่องจากไม่มีกลุ่มอายุ
SHOPPING_ADD_COLOR เพิ่มสีให้กับข้อเสนอที่ถูกลดระดับเนื่องจากไม่มีสี
SHOPPING_ADD_GENDER เพิ่มเพศให้กับข้อเสนอที่ถูกลดระดับเนื่องจากไม่มีเพศ
SHOPPING_ADD_GTIN เพิ่ม GTIN (หมายเลขสินค้าการค้าสากล) ไปยังข้อเสนอที่ถูกลดระดับเนื่องจากไม่มี GTIN
SHOPPING_ADD_MORE_IDENTIFIERS เพิ่มตัวระบุลงในข้อเสนอที่ถูกลดระดับเนื่องจากไม่มีตัวระบุ
SHOPPING_ADD_SIZE เพิ่มขนาดลงในข้อเสนอที่ถูกลดระดับลงเนื่องจากไม่มีขนาด
SHOPPING_ADD_PRODUCTS_TO_CAMPAIGN เพิ่มผลิตภัณฑ์สำหรับแคมเปญที่จะแสดง
SHOPPING_FIX_DISAPPROVED_PRODUCTS แก้ไขผลิตภัณฑ์ที่ไม่ได้รับอนุมัติ
SHOPPING_TARGET_ALL_OFFERS สร้างแคมเปญที่ครอบคลุมทั้งหมดซึ่งกำหนดเป้าหมายข้อเสนอทั้งหมด
SHOPPING_FIX_SUSPENDED_MERCHANT_CENTER_ACCOUNT แก้ไขปัญหาการระงับบัญชี Merchant Center
SHOPPING_FIX_MERCHANT_CENTER_ACCOUNT_SUSPENSION_WARNING แก้ไขปัญหาเกี่ยวกับคำเตือนเกี่ยวกับการระงับบัญชี Merchant Center
DYNAMIC_IMAGE_EXTENSION_OPT_IN เปิดใช้ส่วนขยายรูปภาพแบบไดนามิกในบัญชี
RAISE_TARGET_CPA เพิ่ม CPA เป้าหมาย
LOWER_TARGET_ROAS ROAS เป้าหมายต่ำลง
FORECASTING_SET_TARGET_CPA กำหนด CPA เป้าหมายสำหรับแคมเปญที่ไม่ได้ระบุ CPA เป้าหมายไว้ล่วงหน้าก่อนเทศกาลประจำปีที่คาดว่าจะเพิ่มการเข้าชม
SET_TARGET_CPA กำหนด CPA เป้าหมายสำหรับแคมเปญที่ไม่ได้ระบุ CPA เป้าหมาย
SET_TARGET_ROAS กําหนด ROAS เป้าหมายสําหรับแคมเปญที่ไม่ได้ระบุ ROAS เป้าหมาย
REFRESH_CUSTOMER_MATCH_LIST อัปเดตรายชื่อลูกค้าที่ไม่ได้อัปเดตในช่วง 90 วันที่ผ่านมา
IMPROVE_GOOGLE_TAG_COVERAGE ใช้แท็ก Google ในหน้าเว็บอื่นๆ เพิ่มเติม
CALLOUT_EXTENSION (เลิกใช้งานแล้ว) เลิกใช้งานแล้ว โปรดใช้ CALLOUT_ASSET แทน
SITELINK_EXTENSION (เลิกใช้งานแล้ว) เลิกใช้งานแล้ว โปรดใช้ SITELINK_ASSET แทน
CALL_EXTENSION (เลิกใช้งานแล้ว) เลิกใช้งานแล้ว โปรดใช้ CALL_ASSET แทน
KEYWORD_MATCH_TYPE (เลิกใช้งานแล้ว) เลิกใช้งานแล้ว โปรดใช้ USE_BROAD_MATCH_KEYWORD แทน

ดูวิดีโอนี้เพื่อเรียนรู้เพิ่มเติม

จัดการประเภทที่ไม่รองรับ

เรียกดูคำแนะนำ

วิดีโอ: การเขียนโค้ดสด

ระบบจะดึงข้อมูลRecommendationออบเจ็กต์โดยใช้GoogleAdsService.SearchStreamกับการค้นหาภาษาคำค้นหาของ Google Ads เช่นเดียวกับเอนทิตีอื่นๆ ส่วนใหญ่ใน Google Ads API

สำหรับคำแนะนำแต่ละประเภท ระบบจะให้รายละเอียดในช่องสำหรับคำแนะนำโดยเฉพาะ ตัวอย่างเช่น รายละเอียดของคำแนะนำ CAMPAIGN_BUDGET จะอยู่ในช่อง campaign_budget_recommendation และรวมอยู่ในออบเจ็กต์ CampaignBudgetRecommendation

ค้นหาช่องเฉพาะคำแนะนำทั้งหมดในช่องการรวม recommendation

ผลกระทบของคำแนะนำ

คำแนะนำบางประเภทจะป้อนข้อมูลในช่อง impact ของคำแนะนำ RecommendationImpact มีค่าประมาณผลกระทบที่มีต่อประสิทธิภาพบัญชีอันเป็นผลมาจากการใช้คำแนะนำ เมตริกคำแนะนำต่อไปนี้จะมีอยู่ในช่อง impact.base_metrics และ impact.potential_metrics

  • impressions

  • clicks

  • cost_micros

  • conversions

  • all_conversions (พร้อมให้ใช้งานใน Google Ads API เวอร์ชัน 16)

  • video_views

ตัวอย่างโค้ด

โค้ดตัวอย่างต่อไปนี้จะดึงคำแนะนำประเภท KEYWORD ที่มีและที่ปิดไปแล้วทั้งหมดจากบัญชี แล้วพิมพ์รายละเอียดบางส่วน ดังนี้

Java

try (GoogleAdsServiceClient googleAdsServiceClient =
        googleAdsClient.getLatestVersion().createGoogleAdsServiceClient();
    RecommendationServiceClient recommendationServiceClient =
        googleAdsClient.getLatestVersion().createRecommendationServiceClient()) {
  // Creates a query that retrieves keyword recommendations.
  String query =
      "SELECT recommendation.resource_name, "
          + "  recommendation.campaign, "
          + "  recommendation.keyword_recommendation "
          + "FROM recommendation "
          + "WHERE recommendation.type = KEYWORD";
  // Constructs the SearchGoogleAdsStreamRequest.
  SearchGoogleAdsStreamRequest request =
      SearchGoogleAdsStreamRequest.newBuilder()
          .setCustomerId(Long.toString(customerId))
          .setQuery(query)
          .build();

  // Issues the search stream request to detect keyword recommendations that exist for the
  // customer account.
  ServerStream<SearchGoogleAdsStreamResponse> stream =
      googleAdsServiceClient.searchStreamCallable().call(request);

  // Creates apply operations for all the recommendations found.
  List<ApplyRecommendationOperation> applyRecommendationOperations = new ArrayList<>();
  for (SearchGoogleAdsStreamResponse response : stream) {
    for (GoogleAdsRow googleAdsRow : response.getResultsList()) {
      Recommendation recommendation = googleAdsRow.getRecommendation();
      System.out.printf(
          "Keyword recommendation '%s' was found for campaign '%s'%n",
          recommendation.getResourceName(), recommendation.getCampaign());
      KeywordInfo keyword = recommendation.getKeywordRecommendation().getKeyword();
      System.out.printf("\tKeyword = '%s'%n", keyword.getText());
      System.out.printf("\tMatch type = '%s'%n", keyword.getMatchType());

      // Creates an ApplyRecommendationOperation that will apply this recommendation, and adds
      // it to the list of operations.
      applyRecommendationOperations.add(buildRecommendationOperation(recommendation));
    }
  }
      

C#

// Get the GoogleAdsServiceClient.
GoogleAdsServiceClient googleAdsService = client.GetService(
    Services.V16.GoogleAdsService);

// Creates a query that retrieves keyword recommendations.
string query = "SELECT recommendation.resource_name, " +
    "recommendation.campaign, recommendation.keyword_recommendation " +
    "FROM recommendation WHERE " +
    $"recommendation.type = KEYWORD";

List<ApplyRecommendationOperation> operations =
    new List<ApplyRecommendationOperation>();

try
{
    // Issue a search request.
    googleAdsService.SearchStream(customerId.ToString(), query,
        delegate (SearchGoogleAdsStreamResponse resp)
        {
            Console.WriteLine($"Found {resp.Results.Count} recommendations.");
            foreach (GoogleAdsRow googleAdsRow in resp.Results)
            {
                Recommendation recommendation = googleAdsRow.Recommendation;
                Console.WriteLine("Keyword recommendation " +
                    $"{recommendation.ResourceName} was found for campaign " +
                    $"{recommendation.Campaign}.");

                if (recommendation.KeywordRecommendation != null)
                {
                    KeywordInfo keyword =
                        recommendation.KeywordRecommendation.Keyword;
                    Console.WriteLine($"Keyword = {keyword.Text}, type = " +
                        "{keyword.MatchType}");
                }

                operations.Add(
                    BuildApplyRecommendationOperation(recommendation.ResourceName)
                );
            }
        }
    );
}
catch (GoogleAdsException e)
{
    Console.WriteLine("Failure:");
    Console.WriteLine($"Message: {e.Message}");
    Console.WriteLine($"Failure: {e.Failure}");
    Console.WriteLine($"Request ID: {e.RequestId}");
    throw;
}
      

PHP

$googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();
// Creates a query that retrieves keyword recommendations.
$query = 'SELECT recommendation.resource_name, recommendation.campaign, '
    . 'recommendation.keyword_recommendation '
    . 'FROM recommendation '
    . 'WHERE recommendation.type = KEYWORD ';
// Issues a search request to detect keyword recommendations that exist for the
// customer account.
$response =
    $googleAdsServiceClient->search(SearchGoogleAdsRequest::build($customerId, $query));

$operations = [];
// Iterates over all rows in all pages and prints the requested field values for
// the recommendation in each row.
foreach ($response->iterateAllElements() as $googleAdsRow) {
    /** @var GoogleAdsRow $googleAdsRow */
    $recommendation = $googleAdsRow->getRecommendation();
    printf(
        "Keyword recommendation with resource name '%s' was found for campaign "
        . "with resource name '%s':%s",
        $recommendation->getResourceName(),
        $recommendation->getCampaign(),
        PHP_EOL
    );
    if (!is_null($recommendation->getKeywordRecommendation())) {
        $keyword = $recommendation->getKeywordRecommendation()->getKeyword();
        printf(
            "\tKeyword = '%s'%s\ttype = '%s'%s",
            $keyword->getText(),
            PHP_EOL,
            KeywordMatchType::name($keyword->getMatchType()),
            PHP_EOL
        );
    }
    // Creates an ApplyRecommendationOperation that will be used to apply this
    // recommendation, and adds it to the list of operations.
    $operations[] = self::buildRecommendationOperation($recommendation->getResourceName());
}
      

Python

googleads_service = client.get_service("GoogleAdsService")
query = f"""
    SELECT
      recommendation.campaign,
      recommendation.keyword_recommendation
    FROM recommendation
    WHERE
      recommendation.type = KEYWORD"""

# Detects keyword recommendations that exist for the customer account.
response = googleads_service.search(customer_id=customer_id, query=query)

operations = []
for row in response.results:
    recommendation = row.recommendation
    print(
        f"Keyword recommendation ('{recommendation.resource_name}') "
        f"was found for campaign '{recommendation.campaign}."
    )

    keyword = recommendation.keyword_recommendation.keyword
    print(
        f"\tKeyword = '{keyword.text}'\n" f"\tType = '{keyword.match_type}'"
    )

    # Create an ApplyRecommendationOperation that will be used to apply
    # this recommendation, and add it to the list of operations.
    operations.append(
        build_recommendation_operation(client, recommendation.resource_name)
    )
      

Ruby

query = <<~QUERY
  SELECT recommendation.resource_name, recommendation.campaign,
      recommendation.keyword_recommendation
  FROM recommendation
  WHERE recommendation.type = KEYWORD
QUERY

google_ads_service = client.service.google_ads

response = google_ads_service.search(
  customer_id: customer_id,
  query: query,
)

operations = response.each do |row|
  recommendation = row.recommendation

  puts "Keyword recommendation ('#{recommendation.resource_name}') was found for "\
    "campaign '#{recommendation.campaign}'."

  if recommendation.keyword_recommendation
    keyword = recommendation.keyword_recommendation.keyword
    puts "\tKeyword = '#{keyword.text}'"
    puts "\ttype = '#{keyword.match_type}'"
  end

  build_recommendation_operation(client, recommendation.resource_name)
end
      

Perl

# Create the search query.
my $search_query =
  "SELECT recommendation.resource_name, " .
  "recommendation.campaign, recommendation.keyword_recommendation " .
  "FROM recommendation " .
  "WHERE recommendation.type = KEYWORD";

# Get the GoogleAdsService.
my $google_ads_service = $api_client->GoogleAdsService();

my $search_stream_handler =
  Google::Ads::GoogleAds::Utils::SearchStreamHandler->new({
    service => $google_ads_service,
    request => {
      customerId => $customer_id,
      query      => $search_query
    }});

# Create apply operations for all the recommendations found.
my $apply_recommendation_operations = ();
$search_stream_handler->process_contents(
  sub {
    my $google_ads_row = shift;
    my $recommendation = $google_ads_row->{recommendation};
    printf "Keyword recommendation '%s' was found for campaign '%s'.\n",
      $recommendation->{resourceName}, $recommendation->{campaign};
    my $keyword = $recommendation->{keywordRecommendation}{keyword};
    printf "\tKeyword = '%s'\n",    $keyword->{text};
    printf "\tMatch type = '%s'\n", $keyword->{matchType};
    # Creates an ApplyRecommendationOperation that will apply this recommendation, and adds
    # it to the list of operations.
    push @$apply_recommendation_operations,
      build_recommendation_operation($recommendation);
  });
      

ดำเนินการ

คำแนะนำที่ดึงมาสามารถใช้หรือปิดได้

คำแนะนำอาจเปลี่ยนแปลงได้สำหรับแต่ละวันหรือแม้กระทั่งวันละหลายครั้ง ทั้งนี้ขึ้นอยู่กับประเภทคำแนะนำ เมื่อเกิดกรณีเช่นนี้ขึ้น resource_name ของออบเจ็กต์คำแนะนำอาจล้าสมัยหลังจากที่ดึงคำแนะนำกลับมา

คุณควรดำเนินการตามคำแนะนำไม่นานหลังจากดึงข้อมูล

ใช้คำแนะนำ

วิดีโอ: ใช้คำแนะนำ

คุณใช้คำแนะนำที่ใช้งานอยู่หรือปิดไปแล้วได้โดยใช้เมธอด ApplyRecommendation ของ RecommendationService

ประเภทคำแนะนำอาจมีพารามิเตอร์ที่จำเป็นหรือไม่บังคับก็ได้ คำแนะนำส่วนใหญ่มาพร้อมกับค่าที่แนะนำซึ่งใช้โดยค่าเริ่มต้น

คําแนะนําบางประเภทไม่รองรับการตั้งค่าบัญชีการใช้คําแนะนําโดยอัตโนมัติ แต่คุณใช้ลักษณะการทำงานที่คล้ายกันกับประเภทคำแนะนำที่ Google Ads API รองรับอย่างเต็มรูปแบบได้ ดูข้อมูลเพิ่มเติมในตัวอย่างโค้ด DetectAndApplyRecommendations

ใช้ช่องการรวม apply_parameters ของ ApplyRecommendationOperation เพื่อใช้คำแนะนำกับค่าพารามิเตอร์ที่เฉพาะเจาะจง คำแนะนำที่เหมาะสมแต่ละประเภทจะมีช่องของตนเอง คำแนะนำประเภทที่ไม่ได้ระบุไว้ในช่อง apply_parameters จะไม่ใช้ค่าพารามิเตอร์เหล่านี้

ตัวอย่างโค้ด

โค้ดต่อไปนี้แสดงวิธีการสร้าง ApplyRecommendationOperation และวิธีลบล้างค่าที่แนะนำหากคุณต้องการแทนที่ด้วยค่าของคุณเอง

Java

/** Creates and returns an ApplyRecommendationOperation to apply the given recommendation. */
private ApplyRecommendationOperation buildRecommendationOperation(Recommendation recommendation) {
  // If you have a recommendation ID instead of a resource name, you can create a resource name
  // like this:
  // String resourceName = ResourceNames.recommendation(customerId, recommendationId);

  // Creates a builder to construct the operation.
  Builder operationBuilder = ApplyRecommendationOperation.newBuilder();

  // Each recommendation type has optional parameters to override the recommended values. Below is
  // an example showing how to override a recommended ad when a TextAdRecommendation is applied.
  // operationBuilder.getTextAdBuilder().getAdBuilder().setResourceName("INSERT_AD_RESOURCE_NAME");

  // Sets the operation's resource name to the resource name of the recommendation to apply.
  operationBuilder.setResourceName(recommendation.getResourceName());
  return operationBuilder.build();
}
      

C#

private ApplyRecommendationOperation BuildApplyRecommendationOperation(
    string recommendationResourceName
)
{
    // If you have a recommendation_id instead of the resource_name you can create a
    // resource name from it like this:
    // string recommendationResourceName =
    //    ResourceNames.Recommendation(customerId, recommendationId)

    // Each recommendation type has optional parameters to override the recommended values.
    // This is an example to override a recommended ad when a TextAdRecommendation is
    // applied.
    // For details, please read
    // https://developers.google.com/google-ads/api/reference/rpc/latest/ApplyRecommendationOperation.
    /*
    Ad overridingAd = new Ad()
    {
        Id = "INSERT_AD_ID_AS_LONG_HERE"
    };
    applyRecommendationOperation.TextAd = new TextAdParameters()
    {
        Ad = overridingAd
    };
    */

    ApplyRecommendationOperation applyRecommendationOperation =
    new ApplyRecommendationOperation()
    {
        ResourceName = recommendationResourceName
    };

    return applyRecommendationOperation;
}
      

PHP

private static function buildRecommendationOperation(
    string $recommendationResourceName
): ApplyRecommendationOperation {
    // If you have a recommendation_id instead of the resource name, you can create a resource
    // name from it like this:
    /*
    $recommendationResourceName =
        ResourceNames::forRecommendation($customerId, $recommendationId);
    */

    // Each recommendation type has optional parameters to override the recommended values.
    // This is an example to override a recommended ad when a TextAdRecommendation is applied.
    // For details, please read
    // https://developers.google.com/google-ads/api/reference/rpc/latest/ApplyRecommendationOperation.
    /*
    $overridingAd = new Ad([
        'id' => 'INSERT_AD_ID_AS_INTEGER_HERE'
    ]);
    $applyRecommendationOperation->setTextAd(new TextAdParameters(['ad' => $overridingAd]));
    */

    // Issues a mutate request to apply the recommendation.
    $applyRecommendationOperation = new ApplyRecommendationOperation();
    $applyRecommendationOperation->setResourceName($recommendationResourceName);
    return $applyRecommendationOperation;
}
      

Python

def build_recommendation_operation(client, recommendation):
    """Creates a ApplyRecommendationOperation to apply the given recommendation.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a client customer ID.
        recommendation: a resource name for the recommendation to be applied.
    """
    # If you have a recommendation ID instead of a resource name, you can create
    # a resource name like this:
    #
    # googleads_service = client.get_service("GoogleAdsService")
    # resource_name = googleads_service.recommendation_path(
    #   customer_id, recommendation.id
    # )

    operation = client.get_type("ApplyRecommendationOperation")

    # Each recommendation type has optional parameters to override the
    # recommended values. Below is an example showing how to override a
    # recommended ad when a TextAdRecommendation is applied.
    #
    # operation.text_ad.ad.resource_name = "INSERT_AD_RESOURCE_NAME"
    #
    # For more details, see:
    # https://developers.google.com/google-ads/api/reference/rpc/latest/ApplyRecommendationOperation#apply_parameters

    operation.resource_name = recommendation
    return operation
      

Ruby

def build_recommendation_operation(client, recommendation)
  # If you have a recommendation_id instead of the resource_name
  # you can create a resource name from it like this:
  # recommendation_resource =
  #    client.path.recommendation(customer_id, recommendation_id)

  operations = client.operation.apply_recommendation
  operations.resource_name = recommendation_resource

  # Each recommendation type has optional parameters to override the recommended
  # values. This is an example to override a recommended ad when a
  # TextAdRecommendation is applied.
  #
  # text_ad_parameters = client.resource.text_ad_parameters do |tap|
  #   tap.ad = client.resource.ad do |ad|
  #     ad.id = "INSERT_AD_ID_AS_INTEGER_HERE"
  #   end
  # end
  # operation.text_ad = text_ad_parameters
  #
  # For more details, see:
  # https://developers.google.com/google-ads/api/reference/rpc/latest/ApplyRecommendationOperation#apply_parameters

  return operation
end
      

Perl

sub build_recommendation_operation {
  my ($recommendation) = @_;

  # If you have a recommendation ID instead of a resource name, you can create a resource
  # name like this:
  # my $recommendation_resource_name =
  #   Google::Ads::GoogleAds::V16::Utils::ResourceNames::recommendation(
  #   $customer_id, $recommendation_id);

  # Each recommendation type has optional parameters to override the recommended values.
  # Below is an example showing how to override a recommended ad when a TextAdRecommendation
  # is applied.
  # my $overriding_ad = Google::Ads::GoogleAds::V16::Resources::Ad->new({
  #   id => "INSERT_AD_ID_AS_INTEGER_HERE"
  # });
  # my $text_ad_parameters =
  #   Google::Ads::GoogleAds::V16::Services::RecommendationService::TextAdParameters
  #   ->new({ad => $overriding_ad});
  # $apply_recommendation_operation->{textAd} = $text_ad_parameters;

  # Create an apply recommendation operation.
  my $apply_recommendation_operation =
    Google::Ads::GoogleAds::V16::Services::RecommendationService::ApplyRecommendationOperation
    ->new({
      resourceName => $recommendation->{resourceName}});

  return $apply_recommendation_operation;
}
      

ตัวอย่างถัดไปเรียกใช้ ApplyRecommendation ซึ่งส่งการดำเนินการใช้คำแนะนำที่สร้างขึ้นในโค้ดก่อนหน้า

Java

// Issues a mutate request to apply the recommendations.
ApplyRecommendationResponse applyRecommendationsResponse =
    recommendationServiceClient.applyRecommendation(
        Long.toString(customerId), applyRecommendationOperations);
for (ApplyRecommendationResult applyRecommendationResult :
    applyRecommendationsResponse.getResultsList()) {
  System.out.printf(
      "Applied recommendation with resource name: '%s'.%n",
      applyRecommendationResult.getResourceName());
}
      

C#

private void ApplyRecommendation(GoogleAdsClient client, long customerId,
    List<ApplyRecommendationOperation> operations)
{
    // Get the RecommendationServiceClient.
    RecommendationServiceClient recommendationService = client.GetService(
        Services.V16.RecommendationService);

    ApplyRecommendationRequest applyRecommendationRequest = new ApplyRecommendationRequest()
    {
        CustomerId = customerId.ToString(),
    };

    applyRecommendationRequest.Operations.AddRange(operations);

    ApplyRecommendationResponse response =
        recommendationService.ApplyRecommendation(applyRecommendationRequest);
    foreach (ApplyRecommendationResult result in response.Results)
    {
        Console.WriteLine("Applied a recommendation with resource name: " +
            result.ResourceName);
    }
}
      

PHP

private static function applyRecommendations(
    GoogleAdsClient $googleAdsClient,
    int $customerId,
    array $operations
): void {
    // Issues a mutate request to apply the recommendations.
    $recommendationServiceClient = $googleAdsClient->getRecommendationServiceClient();
    $response = $recommendationServiceClient->applyRecommendation(
        ApplyRecommendationRequest::build($customerId, $operations)
    );
    foreach ($response->getResults() as $appliedRecommendation) {
        /** @var Recommendation $appliedRecommendation */
        printf(
            "Applied a recommendation with resource name: '%s'.%s",
            $appliedRecommendation->getResourceName(),
            PHP_EOL
        );
    }
}
      

Python

def apply_recommendations(client, customer_id, operations):
    """Applies a batch of recommendations.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a client customer ID.
        operations: a list of ApplyRecommendationOperation messages.
    """
    # Issues a mutate request to apply the recommendations.
    recommendation_service = client.get_service("RecommendationService")
    response = recommendation_service.apply_recommendation(
        customer_id=customer_id, operations=operations
    )

    for result in response.results:
        print(
            "Applied a recommendation with resource name: "
            f"'{result[0].resource_name}'."
        )
      

Ruby

def apply_recommendations(client, customer_id, operations)
  # Issues a mutate request to apply the recommendation.
  recommendation_service = client.service.recommendation

  response = recommendation_service.apply_recommendation(
    customer_id: customer_id,
    operations: [operations],
  )

  response.results.each do |applied_recommendation|
    puts "Applied recommendation with resource name: '#{applied_recommendation.resource_name}'."
  end
end
      

Perl

# Issue a mutate request to apply the recommendations.
my $apply_recommendation_response =
  $api_client->RecommendationService()->apply({
    customerId => $customer_id,
    operations => $apply_recommendation_operations
  });

foreach my $result (@{$apply_recommendation_response->{results}}) {
  printf "Applied recommendation with resource name: '%s'.\n",
    $result->{resourceName};
}
      

ดูวิดีโอเหล่านี้เพื่อเรียนรู้เพิ่มเติม

ใช้พารามิเตอร์

เป็นกลุ่ม

ข้อผิดพลาด

การทดสอบ

ปิดคำแนะนำ

วิดีโอ: ปิดวิดีโอแนะนำ

คุณปิดคำแนะนำได้โดยใช้RecommendationService โครงสร้างโค้ดคล้ายกับการใช้คำแนะนำ แต่ใช้ DismissRecommendationOperation และ RecommendationService.DismissRecommendation แทน

ดูวิดีโอเหล่านี้เพื่อเรียนรู้เพิ่มเติม

เป็นกลุ่ม

ข้อผิดพลาด

การทดสอบ

ใช้คำแนะนำโดยอัตโนมัติ

ตั้งแต่ Google Ads API เวอร์ชัน 15 เป็นต้นไป คุณจะใช้ RecommendationSubscriptionService เพื่อนำคำแนะนำบางประเภทไปใช้โดยอัตโนมัติได้

หากต้องการสมัครรับข้อมูลประเภทคำแนะนำที่เจาะจง ให้สร้างออบเจ็กต์ RecommendationSubscription ตั้งค่าช่อง type เป็นประเภทคำแนะนำที่รองรับรายการใดรายการหนึ่ง และตั้งค่าช่อง status เป็น ENABLED

ประเภทคำแนะนำที่การสมัครใช้บริการรองรับ

  • ENHANCED_CPC_OPT_IN
  • KEYWORD
  • KEYWORD_MATCH_TYPE
  • LOWER_TARGET_ROAS
  • MAXIMIZE_CLICKS_OPT_IN
  • OPTIMIZE_AD_ROTATION
  • RAISE_TARGET_CPA
  • RESPONSIVE_SEARCH_AD
  • RESPONSIVE_SEARCH_AD_IMPROVE_AD_STRENGTH
  • SEARCH_PARTNERS_OPT_IN
  • SEARCH_PLUS_OPT_IN
  • SET_TARGET_CPA
  • SET_TARGET_ROAS
  • TARGET_CPA_OPT_IN
  • TARGET_ROAS_OPT_IN
  • USE_BROAD_MATCH_KEYWORD

เรียกข้อมูลการสมัครใช้บริการ

หากต้องการดูข้อมูลเกี่ยวกับการสมัครรับคำแนะนำของบัญชี ให้ค้นหาแหล่งข้อมูล recommendation_subscription

หากต้องการดูการเปลี่ยนแปลงที่ใช้โดยอัตโนมัติ ให้ค้นหาแหล่งข้อมูล change_event โดยกรอง change_client_type เป็น GOOGLE_ADS_RECOMMENDATIONS_SUBSCRIPTION

คําแนะนําในการสร้างแคมเปญ

ตั้งแต่ Google Ads API เวอร์ชัน 16 เป็นต้นไป คุณจะใช้ RecommendationService.GenerateRecommendationsRequest เพื่อสร้างคำแนะนำระหว่างการสร้างแคมเปญสำหรับชุดคำแนะนำหนึ่งๆ ได้

GenerateRecommendations ยอมรับอินพุตสำหรับรหัสลูกค้า ซึ่งเป็นประเภทช่องทางการโฆษณาที่ต้องเป็น SEARCH หรือ PERFORMANCE_MAX รายการประเภทคำแนะนำที่จะสร้าง และจุดข้อมูลต่างๆ ที่ขึ้นอยู่กับประเภทที่ระบุ ระบบจะแสดงรายการออบเจ็กต์ Recommendation รายการตามข้อมูลที่คุณให้ไว้ หากมีข้อมูลไม่เพียงพอที่จะสร้างคำแนะนำสำหรับ recommendation_types ที่ขอ หรือหากแคมเปญอยู่ในสถานะที่แนะนำอยู่แล้ว ชุดผลลัพธ์จะไม่มีคำแนะนำสำหรับประเภทดังกล่าว ตรวจสอบว่าแอปพลิเคชันของคุณจัดการกรณีที่ไม่มีการส่งกลับคำแนะนำสำหรับประเภทคำแนะนำที่ขอ

ตารางต่อไปนี้อธิบายประเภทคำแนะนำที่ GenerateRecommendations รองรับ รวมถึงช่องที่คุณต้องระบุเพื่อรับคำแนะนำสำหรับประเภทนั้นๆ แนวทางปฏิบัติแนะนำคือให้ส่งคำขอ GenerateRecommendations หลังจากรวบรวมข้อมูลทั้งหมดที่เกี่ยวข้องกับประเภทคำแนะนำที่ขอแล้ว ดูรายละเอียดเพิ่มเติมเกี่ยวกับฟิลด์ที่จำเป็นและฟิลด์ที่ไม่บังคับ รวมถึงช่องที่ฝังในเอกสารอ้างอิง

RecommendationType ฟิลด์ที่จำเป็น ช่องที่ไม่บังคับ
KEYWORD
  • seed_info
  • ad_group_info
MAXIMIZE_CLICKS_OPT_IN
  • conversion_tracking_status
  • bidding_info
MAXIMIZE_CONVERSIONS_OPT_IN
  • conversion_tracking_status
  • bidding_info
MAXIMIZE_CONVERSION_VALUE_OPT_IN
  • conversion_tracking_status
  • bidding_info
SET_TARGET_CPA
  • conversion_tracking_status
  • bidding_info
SET_TARGET_ROAS
  • conversion_tracking_status
  • bidding_info
SITELINK_ASSET
หมายเหตุ: ออบเจ็กต์ SitelinkAssetRecommendation ที่แสดงผลจะแสดงรายการที่ว่างเปล่า หากการตอบกลับ GenerateRecommendations มี SitelinkAssetRecommendation ระบบจะถือว่าการตอบกลับนี้เป็นสัญญาณให้เพิ่มชิ้นงานไซต์ลิงก์อย่างน้อย 1 รายการลงในแคมเปญ
  • campaign_sitelink_count
TARGET_CPA_OPT_IN
  • conversion_tracking_status
  • bidding_info
TARGET_ROAS_OPT_IN
  • conversion_tracking_status
  • bidding_info

ตัวอย่างขั้นตอนการใช้งาน

สมมติว่าบริษัทของคุณเป็นเอเจนซีโฆษณาซึ่งให้เวิร์กโฟลว์การสร้างแคมเปญแก่ผู้ใช้ และคุณต้องการเสนอคำแนะนำแก่ผู้ใช้ในระหว่างกระบวนการดังกล่าว คุณสามารถใช้ GenerateRecommendationsRequest เพื่อสร้างคำแนะนำแบบออนดีมานด์ แล้วรวมคำแนะนำเหล่านั้นไว้ในอินเทอร์เฟซผู้ใช้การสร้างแคมเปญได้

ขั้นตอนการใช้งานอาจมีลักษณะดังนี้

  1. ผู้ใช้มาที่แอปพลิเคชันของคุณเพื่อสร้างแคมเปญ Performance Max

  2. ผู้ใช้ให้ข้อมูลเบื้องต้นบางอย่างในขั้นตอนการสร้างแคมเปญ เช่น ให้รายละเอียดในการสร้างSitelinkAssetรายการเดียว และเลือก TARGET_SPEND เป็นกลยุทธ์ Smart Bidding

  3. โดยจะส่ง GenerateRecommendationsRequest ซึ่งตั้งค่าช่องต่อไปนี้

    • campaign_sitelink_count: ตั้งค่าเป็น 1 ซึ่งเป็นจำนวนชิ้นงานไซต์ลิงก์ในแคมเปญที่อยู่ระหว่างดำเนินการ

    • bidding_info: ตั้งค่าช่อง bidding_strategy_type ที่ฝังไว้เป็น TARGET_SPEND

    • conversion_tracking_status: ตั้งค่าเป็น ConversionTrackingStatus ของลูกค้ารายนี้ สำหรับคำแนะนำเกี่ยวกับวิธีดึงข้อมูลช่องนี้ โปรดดูคู่มือเริ่มต้นใช้งานสำหรับการจัดการ Conversion

    • recommendation_types: ตั้งเป็น [SITELINK_ASSET, MAXIMIZE_CLICKS_OPT_IN]

    • advertising_channel_type: ตั้งเป็น PERFORMANCE_MAX

    • customer_id: ตั้งเป็นรหัสของลูกค้าที่สร้างแคมเปญ

  4. คุณสามารถดูคำแนะนำใน GenerateRecommendationsResponse ซึ่งในกรณีนี้คือ SitelinkAssetRecommendation และ MaximizeClicksOptInRecommendation และแนะนำให้ผู้ใช้ทราบโดยแสดงไว้ในอินเทอร์เฟซการสร้างแคมเปญ หากผู้ใช้ยอมรับคำแนะนำ คุณจะรวมคำแนะนำนั้นไว้ในคำขอสร้างแคมเปญเมื่อผู้ใช้ดำเนินการตามขั้นตอนการสร้างแคมเปญจนเสร็จสมบูรณ์ได้