Tạo đường cong phạm vi tiếp cận

Sau khi thu thập các chế độ cài đặt tiêu chí nhắm mục tiêu và kiểu kết hợp các loại quảng cáo cho kế hoạch truyền thông, bạn có thể tạo một đường cong ngân sách so với phạm vi tiếp cận tiềm năng bằng cách sử dụng phương thức GenerateReachForecast trong ReachPlanService. Hãy xem bảng chú giải thuật ngữ và hướng dẫn về kế hoạch truyền thông để biết thông tin chi tiết về các trường yêu cầu.

Chỉ số dự báo

Phản hồi từ GenerateReachForecast bao gồm nhiều chỉ số trong thông báo Forecast, cung cấp thông tin chi tiết về hiệu suất tiềm năng của chiến dịch mà bạn đã lên kế hoạch. Các chỉ số này bao gồm:

  • Phạm vi tiếp cận (đúng mục tiêu và tổng thể, bao gồm cả cùng xem)
  • Số lượt hiển thị (đúng mục tiêu và tổng số, bao gồm cả số lượt cùng xem và số lượt xem được)
  • Thông tin chi tiết về tần suất hiệu quả (số người dùng riêng biệt được tiếp cận ít nhất một số lần nhất định; ví dụ: 1+, 2+ hoặc 3+ lượt hiển thị)
  • Hành động của người dùng (lượt xem theo TrueView, lượt chuyển đổi và lượt nhấp)

Dự đoán phạm vi tiếp cận cho chiến dịch Tạo nhu cầu

Khi tạo đường cong cho DEMAND_GEN sản phẩm có thể lập kế hoạch, bạn cũng phải thêm tỷ lệ chuyển đổi dự kiến cho từng sản phẩm.

Để nhận đề xuất về tỷ lệ chuyển đổi cho các sản phẩm có thể lập kế hoạch được hỗ trợ, hãy sử dụng phương thức GenerateConversionRates. Phương thức này trả về các đề xuất về tỷ lệ chuyển đổi dựa trên hiệu suất trước đây của tài khoản hoặc tỷ lệ đề xuất dựa trên hiệu suất của tất cả nhà quảng cáo.

Đối với DEMAND_GEN sản phẩm, GenerateConversionRates có thể trả về nhiều đề xuất cho cùng một sản phẩm. Một số đề xuất có sẵn trường surface_targeting, cho biết đề xuất đó chỉ áp dụng cho một kiểu kết hợp cụ thể của các nền tảng (ví dụ: YouTube Shorts). Nếu surface_targeting không được điền sẵn, thì đề xuất này là mức trung bình của chiến dịch Tạo nhu cầu cho sản phẩm đó. Khi tạo thông tin dự báo cho chiến dịch Tạo nhu cầu có tiêu chí nhắm mục tiêu theo nền tảng, hãy sử dụng đề xuất tỷ lệ chuyển đổi cụ thể nhất hiện có.

Ngoài tỷ lệ chuyển đổi, người dùng chiến dịch Tạo nhu cầu có thể sử dụng GenerateReachForecast để dự đoán clicks, điều này đặc biệt phù hợp với những chiến dịch tối ưu hoá cho lượt nhấp, chẳng hạn như chiến dịch Tạo nhu cầu sử dụng chiến lược đặt giá thầu Tối đa hoá số lượt nhấp.

Dự đoán phạm vi tiếp cận cho YouTube Select

YouTube Select (YTS) trong ReachPlanService hỗ trợ tính năng nhắm mục tiêu theo cấp nhóm kênh nổi tiếng cho tất cả các vị trí đủ điều kiện của YTS theo mô hình Đặt trước nhanh. Sử dụng trường youtube_select_lineup_targeting trong ReachPlanService.ListPlannableProducts để xác định các nhóm kênh hiện có (youtube_select_lineup_targeting thay thế trường youtube_select_lineups, trường này không còn được dùng nữa trong v23 và đã bị xoá trong v24).

Khi sử dụng tính năng Đặt trước nhanh, bạn có thể gặp phải các lỗi sau khi yêu cầu dự báo cho YTS:

Lưu đường cong

Bạn chỉ có thể lưu từng đường cong để mang lại sự thuận tiện cho người dùng. Nghiêm cấm việc lưu trữ hàng loạt đường cong vào bộ nhớ đệm. Nếu bạn cần tạo đường cong hàng loạt, hãy liên hệ với nhân viên phụ trách khách hàng của Google trước.

Xử lý lỗi

Yêu cầu gửi đến ReachPlanService phải tuân theo cấu trúc API cơ bản và có thể trả về lỗi phổ biến nếu không xác thực được.

Ngoài các lỗi thường gặp, ReachPlanService có thể trả về các lỗi cụ thể của Công cụ lập kế hoạch tiếp cận được liệt kê trong ReachPlanError.

Ví dụ về mã

Đường cong này bao gồm số lượt hiển thị và phạm vi tiếp cận người dùng dưới dạng số tuyệt đối, cũng như quy mô tổng thể tương ứng với số người theo dữ liệu điều tra dân số và quy mô đối tượng trên YouTube cho nhóm nhân khẩu học và quốc gia được yêu cầu.

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

Trình theo dõi sự cố của Google

Sử dụng Trình theo dõi sự cố của Google để đặt câu hỏi hỗ trợ, báo cáo lỗi hoặc gửi yêu cầu về tính năng. Google theo dõi, ưu tiên và đăng thông tin cập nhật về yêu cầu của bạn ngay trong Trình theo dõi sự cố. Để biết thêm thông tin, hãy xem bài viết Tạo vấn đề trong Trình theo dõi sự cố của Google.

Tạo một vấn đề bằng cách sử dụng một trong các mẫu Trình theo dõi sự cố sau:

Điền thông tin chi tiết vào tất cả các trường trong mẫu để Google có thể tái hiện và ưu tiên yêu cầu của bạn. Google có thể đóng các báo cáo chưa hoàn chỉnh và yêu cầu bạn gửi một vấn đề mới kèm theo thông tin còn thiếu.