สร้างเส้นโค้งการเข้าถึง

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

เมตริกการคาดการณ์

การตอบกลับจาก GenerateReachForecast จะรวมเมตริกต่างๆ ภายในข้อความ Forecast ซึ่งให้ข้อมูลเชิงลึกเกี่ยวกับประสิทธิภาพที่เป็นไปได้ของแคมเปญที่วางแผนไว้ เมตริกเหล่านี้ประกอบด้วยรายการต่อไปนี้

  • การเข้าถึง (ตามเป้าหมายและทั้งหมด รวมถึงการดูร่วมกัน)
  • การแสดงผล (ตามเป้าหมายและทั้งหมด รวมถึงการดูร่วมกันและการแสดงผลที่มองเห็นได้)
  • รายละเอียดความถี่ที่มีประสิทธิภาพ (จำนวนผู้ใช้ที่ไม่ซ้ำที่เข้าถึงอย่างน้อยจำนวนครั้งที่กำหนด เช่น การแสดงผล 1+, 2+ หรือ 3+ ครั้ง)
  • การกระทำของผู้ใช้ (ยอดดู TrueView, Conversion และการคลิก)

คาดการณ์การเข้าถึงสําหรับ Demand Gen

เมื่อสร้างเส้นโค้งสำหรับผลิตภัณฑ์ที่วางแผนได้ DEMAND_GEN รายการ คุณต้องระบุอัตรา Conversion ที่คาดไว้สำหรับผลิตภัณฑ์แต่ละรายการด้วย

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

สำหรับสินค้า DEMAND_GEN รายการ GenerateConversionRates อาจแสดงคำแนะนำหลายรายการสำหรับสินค้าเดียวกัน คำแนะนำบางรายการมีช่อง surface_targeting ซึ่งระบุว่าคำแนะนำนั้นใช้ได้กับแพลตฟอร์มที่เฉพาะเจาะจงเท่านั้น (เช่น YouTube Shorts) หากไม่ได้ป้อนข้อมูล surface_targeting คำแนะนำจะเป็นค่าเฉลี่ยของแคมเปญ Demand Gen สำหรับผลิตภัณฑ์นั้น เมื่อสร้างการคาดการณ์สําหรับแคมเปญ Demand Gen ที่มีการกำหนดเป้าหมายแพลตฟอร์ม ให้ใช้คําแนะนําอัตรา Conversion ที่เจาะจงที่สุดที่มีอยู่

นอกจากอัตรา Conversion แล้ว ผู้ใช้ Demand Gen ยังสามารถใช้ GenerateReachForecast เพื่อคาดการณ์ clicks ซึ่งเกี่ยวข้องกับแคมเปญที่เพิ่มประสิทธิภาพเพื่อการคลิกโดยเฉพาะ เช่น Demand Gen ที่ใช้การเสนอราคาแบบเพิ่มจำนวนคลิกสูงสุด

คาดการณ์การเข้าถึงสำหรับ YouTube Select

YouTube Select (YTS) ใน ReachPlanService รองรับการกำหนดเป้าหมายระดับรายการช่องสำหรับสถานที่ตั้ง YTS ที่มีสิทธิ์ทั้งหมดในราคาแบบจองทันที ใช้ช่อง youtube_select_lineup_targeting ใน ReachPlanService.ListPlannableProducts เพื่อระบุรายการช่องที่พร้อมใช้งาน (youtube_select_lineup_targeting แทนที่ช่อง youtube_select_lineups ซึ่งเลิกใช้งานแล้วใน v23 และนำออกใน v24)

เมื่อใช้ฟีเจอร์จองทันที ข้อผิดพลาดต่อไปนี้อาจเกิดขึ้นเมื่อขอการคาดการณ์สำหรับ YTS

บันทึกเส้นโค้ง

คุณบันทึกได้เฉพาะเส้นโค้งแต่ละเส้นเพื่ออำนวยความสะดวกให้แก่ผู้ใช้ ห้ามแคชเส้นโค้งจำนวนมากโดยเด็ดขาด หากต้องการสร้างเส้นโค้งจำนวนมาก โปรดติดต่อตัวแทนฝ่ายดูแลลูกค้าของ Google ก่อน

การจัดการข้อผิดพลาด

คำขอไปยัง ReachPlanService ต้องเป็นไปตามโครงสร้าง API พื้นฐาน และอาจแสดงข้อผิดพลาดที่พบบ่อยหากไม่ผ่านการตรวจสอบความถูกต้อง

นอกจากข้อผิดพลาดที่พบบ่อยแล้ว ReachPlanService ยังแสดงข้อผิดพลาดที่เฉพาะเจาะจงกับการวางแผน Reach Planner ที่แสดงใน ReachPlanError ได้ด้วย

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

เส้นโค้งนี้ประกอบด้วยการแสดงผลและการเข้าถึงผู้ใช้ในจำนวนสัมบูรณ์ รวมถึงขนาดจักรวาลที่สอดคล้องกับประชากรจากการทำสำมะโนประชากรและขนาดกลุ่มเป้าหมาย YouTube สำหรับข้อมูลประชากรและประเทศที่ขอ

Java

private void getReachCurve(
    ReachPlanServiceClient reachPlanServiceClient, GenerateReachForecastRequest request) {
  GenerateReachForecastResponse response = reachPlanServiceClient.generateReachForecast(request);
  System.out.println("Reach curve output:");
  System.out.println(
      "Currency, Cost Micros, On-Target Reach, On-Target Imprs, Total Reach, Total Imprs,"
          + " Products");
  for (ReachForecast point : response.getReachCurve().getReachForecastsList()) {
    System.out.printf(
        "%s, \"",
        Joiner.on(", ")
            .join(
                request.getCurrencyCode(),
                String.valueOf(point.getCostMicros()),
                String.valueOf(point.getForecast().getOnTargetReach()),
                String.valueOf(point.getForecast().getOnTargetImpressions()),
                String.valueOf(point.getForecast().getTotalReach()),
                String.valueOf(point.getForecast().getTotalImpressions())));
    for (PlannedProductReachForecast product : point.getPlannedProductReachForecastsList()) {
      System.out.printf("[Product: %s, ", product.getPlannableProductCode());
      System.out.printf("Budget Micros: %s]", product.getCostMicros());
    }
    System.out.printf("\"%n");
  }
}
      

C#

public void GetReachCurve(ReachPlanServiceClient reachPlanService,
    GenerateReachForecastRequest request)
{
    GenerateReachForecastResponse response = reachPlanService.GenerateReachForecast(
        request);
    Console.WriteLine("Reach curve output:");
    Console.WriteLine(
        "Currency, Cost Micros, On-Target Reach, On-Target Impressions, Total Reach," +
        " Total Impressions, Products");
    foreach (ReachForecast point in response.ReachCurve.ReachForecasts)
    {
        Console.Write($"{request.CurrencyCode}, ");
        Console.Write($"{point.CostMicros}, ");
        Console.Write($"{point.Forecast.OnTargetReach}, ");
        Console.Write($"{point.Forecast.OnTargetImpressions}, ");
        Console.Write($"{point.Forecast.TotalReach}, ");
        Console.Write($"{point.Forecast.TotalImpressions}, ");
        Console.Write("\"[");
        foreach (PlannedProductReachForecast productReachForecast in
            point.PlannedProductReachForecasts)
        {
            Console.Write($"(Product: {productReachForecast.PlannableProductCode}, ");
            Console.Write($"Budget Micros: {productReachForecast.CostMicros}), ");
        }

        Console.WriteLine("]\"");
    }
}
      

PHP

private static function getReachCurve(
    GoogleAdsClient $googleAdsClient,
    int $customerId,
    array $productMix,
    string $locationId,
    string $currencyCode
) {
    // Valid durations are between 1 and 90 days.
    $duration = new CampaignDuration(['duration_in_days' => 28]);
    $targeting = new Targeting([
        'plannable_location_id' => $locationId,
        'age_range' => ReachPlanAgeRange::AGE_RANGE_18_65_UP,
        'genders' => [
            new GenderInfo(['type' => GenderType::FEMALE]),
            new GenderInfo(['type' => GenderType::MALE])
        ],
        'devices' => [
            new DeviceInfo(['type' => Device::DESKTOP]),
            new DeviceInfo(['type' => Device::MOBILE]),
            new DeviceInfo(['type' => Device::TABLET])
        ]
    ]);

    // See the docs for defaults and valid ranges:
    // https://developers.google.com/google-ads/api/reference/rpc/latest/GenerateReachForecastRequest
    $response = $googleAdsClient->getReachPlanServiceClient()->generateReachForecast(
        GenerateReachForecastRequest::build($customerId, $duration, $productMix)
            ->setCurrencyCode($currencyCode)
            ->setTargeting($targeting)
    );

    printf(
        "Reach curve output:%sCurrency, Cost Micros, On-Target Reach, On-Target Imprs," .
            " Total Reach, Total Imprs, Products%s",
        PHP_EOL,
        PHP_EOL
    );
    foreach ($response->getReachCurve()->getReachForecasts() as $point) {
        $products = '';
        /** @var ReachForecast $point */
        foreach ($point->getPlannedProductReachForecasts() as $plannedProductReachForecast) {
            /** @var PlannedProductReachForecast $plannedProductReachForecast */
            $products .= sprintf(
                '(Product: %s, Budget Micros: %s)',
                $plannedProductReachForecast->getPlannableProductCode(),
                $plannedProductReachForecast->getCostMicros()
            );
        }
        printf(
            "%s, %d, %d, %d, %d, %d, %s%s",
            $currencyCode,
            $point->getCostMicros(),
            $point->getForecast()->getOnTargetReach(),
            $point->getForecast()->getOnTargetImpressions(),
            $point->getForecast()->getTotalReach(),
            $point->getForecast()->getTotalImpressions(),
            $products,
            PHP_EOL
        );
    }
}
      

Python

def request_reach_curve(
    client: GoogleAdsClient,
    customer_id: str,
    product_mix: list[PlannedProduct],
    location_id: str,
    currency_code: str,
):
    """Creates a sample request for a given product mix.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: The customer ID for the reach forecast.
        product_mix: The product mix for the reach forecast.
        location_id: The location ID to plan for.
        currency_code: Three-character ISO 4217 currency code.
    """
    # See the docs for defaults and valid ranges:
    # https://developers.google.com/google-ads/api/reference/rpc/latest/GenerateReachForecastRequest
    request: GenerateReachForecastRequest = client.get_type(
        "GenerateReachForecastRequest"
    )
    request.customer_id = customer_id
    # Valid durations are between 1 and 90 days.
    request.campaign_duration.duration_in_days = 28
    request.currency_code = currency_code
    request.cookie_frequency_cap = 0
    request.min_effective_frequency = 1
    request.planned_products = product_mix

    request.targeting.plannable_location_id = location_id
    request.targeting.age_range = (
        client.enums.ReachPlanAgeRangeEnum.AGE_RANGE_18_65_UP
    )

    # Add gender targeting to the request.
    gender_type: GenderTypeEnum
    for gender_type in [
        client.enums.GenderTypeEnum.FEMALE,
        client.enums.GenderTypeEnum.MALE,
    ]:
        gender: GenderInfo = client.get_type("GenderInfo")
        gender.type_ = gender_type
        request.targeting.genders.append(gender)

    # Add device targeting to the request.
    device_type: DeviceEnum
    for device_type in [
        client.enums.DeviceEnum.DESKTOP,
        client.enums.DeviceEnum.MOBILE,
        client.enums.DeviceEnum.TABLET,
    ]:
        device: DeviceInfo = client.get_type("DeviceInfo")
        device.type_ = device_type
        request.targeting.devices.append(device)

    reach_plan_service: ReachPlanServiceClient = client.get_service(
        "ReachPlanService"
    )
    response: GenerateReachForecastResponse = (
        reach_plan_service.generate_reach_forecast(request=request)
    )

    print(
        "Currency, Cost, On-Target Reach, On-Target Imprs, Total Reach,"
        " Total Imprs, Products"
    )
    point: ReachForecast
    for point in response.reach_curve.reach_forecasts:
        product_splits = []
        p: PlannedProductReachForecast
        for p in point.planned_product_reach_forecasts:
            product_splits.append(
                {p.plannable_product_code: p.cost_micros / ONE_MILLION}
            )
        print(
            [
                currency_code,
                point.cost_micros / ONE_MILLION,
                point.forecast.on_target_reach,
                point.forecast.on_target_impressions,
                point.forecast.total_reach,
                point.forecast.total_impressions,
                product_splits,
            ]
        )
      

Ruby

def get_reach_curve(
  client,
  reach_plan_service,
  customer_id,
  product_mix,
  location_id,
  currency_code)
  duration = client.resource.campaign_duration do |d|
    # Valid durations are between 1 and 90 days.
    d.duration_in_days = 28
  end

  targeting = client.resource.targeting do |t|
    t.plannable_location_id = location_id
    t.age_range = :AGE_RANGE_18_65_UP
    t.genders << client.resource.gender_info do |gender|
      gender.type = :FEMALE
    end
    t.genders << client.resource.gender_info do |gender|
      gender.type = :MALE
    end
    t.devices << client.resource.device_info do |device|
      device.type = :DESKTOP
    end
    t.devices << client.resource.device_info do |device|
      device.type = :MOBILE
    end
    t.devices << client.resource.device_info do |device|
      device.type = :TABLET
    end
  end

  # See the docs for defaults and valid ranges:
  # https://developers.google.com/google-ads/api/reference/rpc/latest/GenerateReachForecastRequest
  response = reach_plan_service.generate_reach_forecast(
    customer_id: customer_id,
    campaign_duration: duration,
    planned_products: product_mix,
    currency_code: currency_code,
    targeting: targeting,
  )

  puts "Reach curve output:"
  puts "Currency, Cost Micros, On-Target Reach, On-Target Imprs, " \
    "Total Reach, Total Imprs, Products"

  response.reach_curve.reach_forecasts.each do |point|
    products = ""
    point.planned_product_reach_forecasts.each do |product|
      products += "(Product: #{product.plannable_product_code}, "\
        "Cost Micros: #{product.cost_micros})"
    end
    puts "#{currency_code}, #{point.cost_micros}, " \
      "#{point.forecast.on_target_reach}, " \
      "#{point.forecast.on_target_impressions}, " \
      "#{point.forecast.total_reach}, " \
      "#{point.forecast.total_impressions}, " \
      "#{products}"
  end
end
      

Perl

sub pull_reach_curve {
  my ($reach_plan_service, $reach_request) = @_;

  my $response = $reach_plan_service->generate_reach_forecast($reach_request);
  print "Reach curve output:\n";
  print "Currency,\tCost Micros,\tOn-Target Reach,\tOn-Target Imprs,\t" .
    "Total Reach,\tTotal Imprs,\tProducts\n";
  foreach my $point (@{$response->{reachCurve}{reachForecasts}}) {
    printf "%s,\t%d,\t%d,\t%d,\t%d,\t%d,\t'[", $reach_request->{currencyCode},
      $point->{costMicros}, $point->{forecast}{onTargetReach},
      $point->{forecast}{onTargetImpressions}, $point->{forecast}{totalReach},
      $point->{forecast}{totalImpressions};
    foreach my $productReachForecast (@{$point->{plannedProductReachForecasts}})
    {
      printf "(Product: %s, Budget Micros: %d), ",
        $productReachForecast->{plannableProductCode},
        $productReachForecast->{costMicros};
    }
    print "]'\n";
  }
}
      

curl

Google Issue Tracker

ใช้ Issue Tracker ของ Google เพื่อถามคำถามเกี่ยวกับการสนับสนุน รายงานข้อบกพร่อง หรือส่งคำขอฟีเจอร์ Google จะติดตาม จัดลำดับความสำคัญ และโพสต์ข้อมูลอัปเดตเกี่ยวกับคำขอของคุณใน Issue Tracker โดยตรง ดูข้อมูลเพิ่มเติมได้ที่สร้างปัญหาใน Issue Tracker ของ Google

สร้างปัญหาโดยใช้เทมเพลต Issue Tracker อย่างใดอย่างหนึ่งต่อไปนี้

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