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

วิดีโอ: เจาะลึกรายละเอียด

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

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

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

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

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

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

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

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

  1. metrics.optimization_score_url จะให้ลิงก์ในรายละเอียดเข้าไปในบัญชีเพื่อดูข้อมูลเกี่ยวกับ คำแนะนำใน 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 เช่นเดียวกับเอนทิตีอื่นๆ ส่วนใหญ่ใน Google Ads API ออบเจ็กต์จะดึงข้อมูลโดยใช้ GoogleAdsService.SearchStream ด้วยคำค้นหา Google Ads Query Language

รายละเอียดสำหรับคำแนะนำแต่ละประเภทจะอยู่ใน ช่องคำแนะนำเฉพาะ เช่น คำแนะนำ 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.V17.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::V17::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::V17::Resources::Ad->new({
  #   id => "INSERT_AD_ID_AS_INTEGER_HERE"
  # });
  # my $text_ad_parameters =
  #   Google::Ads::GoogleAds::V17::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::V17::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.V17.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 -และแนะนำโฆษณาแก่ผู้ใช้โดยการแสดงไว้ภายในแคมเปญของคุณ อินเทอร์เฟซในการก่อสร้าง หากผู้ใช้ยอมรับคำแนะนำ คุณสามารถ รวมข้อมูลดังกล่าวไว้ในคำขอสร้างแคมเปญเมื่อผู้ใช้กรอกข้อมูล ขั้นตอนการสร้างแคมเปญ