Điều chỉnh giá thầu bằng hệ số điều chỉnh giá thầu

Bạn có thể sử dụng API Google Ads để đặt hệ số điều chỉnh giá thầu cho quảng cáo khách sạn. Để biết thông tin chi tiết về cách hoạt động của hệ số điều chỉnh giá thầu, hãy xem bài viết Giới thiệu về hệ số điều chỉnh giá thầu cho Quảng cáo khách sạn.

Mức điều chỉnh giá thầu cấp chiến dịch

Để sử dụng Google Ads API nhằm đặt hệ số điều chỉnh giá thầu ở cấp chiến dịch, hãy xem bài viết Quản lý hệ số điều chỉnh giá thầu.

Mức điều chỉnh giá thầu ở cấp nhóm quảng cáo

Kể từ phiên bản 26, 5 tiêu chí dành riêng cho khách sạn trên AdGroupBidModifier được đổi tên thành tên không phụ thuộc vào ngành dọc (chẳng hạn như ngày bắt đầu trong tuần và thời gian đặt phòng), thay thế các tiêu chí dành riêng cho khách sạn trong các phiên bản trước. Những mức điều chỉnh giá thầu này vẫn chỉ được hỗ trợ cho quảng cáo khách sạn, cả trong chiến dịch Khách sạn và chiến dịch Tìm kiếm cho du lịch. Các hệ số điều chỉnh giá thầu hiện có được tạo trong phiên bản 25 trở xuống sẽ tự động được chuyển sang với mã tiêu chí và tên tài nguyên giống hệt nhau. Để xem thông tin tóm tắt về tất cả các thay đổi có thể gây lỗi trong phiên bản 26, hãy xem ghi chú phát hành.

Để đặt mức điều chỉnh giá thầu ở cấp nhóm quảng cáo, hãy tạo một đối tượng tiêu chí cho phương diện mà bạn muốn nhắm đến và đặt các trường của đối tượng đó thành giá trị thích hợp. Trong phiên bản 26 trở lên, hãy sử dụng các đối tượng tiêu chí không phụ thuộc vào ngành dọc: AdvanceBookingWindowInfo, UserSetDatesInfo, StartDayOfWeekInfo, LengthOfBookingInfo hoặc StartDateRangeInfo. Trong phiên bản 25 trở xuống, hãy sử dụng các đối tượng tiêu chí dành riêng cho khách sạn: HotelAdvanceBookingWindowInfo, HotelDateSelectionTypeInfo, HotelCheckInDayInfo, HotelLengthOfStayInfo hoặc HotelCheckInDateRangeInfo.

Bảng sau đây tóm tắt các trường tiêu chí AdGroupBidModifier, loại thông báo, trường phụ và phạm vi bid_modifier hợp lệ trên các phiên bản API:

v25 trở xuống phiên bản 26 trở lên Trường con và loại Nội dung mô tả và phạm vi hợp lệ
hotel_date_selection_type (HotelDateSelectionTypeInfo) user_set_dates (UserSetDatesInfo) type: DateSelectionType trong phiên bản 26 (HotelDateSelectionType trong phiên bản 25). Giá trị: DEFAULT_SELECTION (mã tiêu chí 50), USER_SELECTED (mã tiêu chí 51). IMMUTABLE. Ngày mặc định so với ngày do người dùng chọn. Phạm vi bid_modifier hợp lệ: 0.5 đến 2.0 (không hỗ trợ lựa chọn không tham gia 0).
hotel_advance_booking_window (HotelAdvanceBookingWindowInfo) advance_booking_window (AdvanceBookingWindowInfo) min_days, max_days (int64, 0–330). IMMUTABLE, bắt buộc. Số ngày trước ngày bắt đầu đặt phòng. Phạm vi bid_modifier hợp lệ: 0.1 đến 10.0 hoặc 0 để chọn không sử dụng.
hotel_length_of_stay (HotelLengthOfStayInfo) length_of_booking (LengthOfBookingInfo) min_days, max_days trong phiên bản 26 (min_nights, max_nights trong phiên bản 25) (int64, 1–30). IMMUTABLE, bắt buộc. Thời lượng đặt phòng. Phạm vi bid_modifier hợp lệ: 0.1 đến 10.0 hoặc 0 để chọn không sử dụng.
hotel_check_in_day (HotelCheckInDayInfo) start_day_of_week (StartDayOfWeekInfo) day_of_week (DayOfWeek, mã tiêu chí 60–66 cho MONDAY–SUNDAY). IMMUTABLE. Ngày trong tuần của ngày bắt đầu đặt phòng. Phạm vi bid_modifier hợp lệ: 0.1 đến 10.0 hoặc 0 để chọn không sử dụng.
hotel_check_in_date_range (HotelCheckInDateRangeInfo) start_date_range (StartDateRangeInfo) start_date, end_date (string, YYYY-MM-DD). IMMUTABLE, bắt buộc. Phạm vi ngày của ngày bắt đầu đặt phòng. Phạm vi bid_modifier hợp lệ: 0.1 đến 10.0 hoặc 0 để chọn không sử dụng.

Ví dụ: để tạo hệ số điều chỉnh giá thầu nhóm quảng cáo bằng cách sử dụng thời hạn đặt trước từ 30 đến 60 ngày trong phiên bản 26 trở lên, hãy tạo một đối tượng AdvanceBookingWindowInfo (hoặc HotelAdvanceBookingWindowInfo trong phiên bản 25 trở xuống) rồi đặt min_days thành 30 và max_days thành 60.

Liên kết đối tượng tiêu chí với đối tượng AdGroupBidModifier bằng cách sử dụng trường tiêu chí tương ứng (advance_booking_window, user_set_dates, start_day_of_week, length_of_booking hoặc start_date_range), chỉ định tên tài nguyên của nhóm quảng cáo mục tiêu bằng ad_group và đặt trường bid_modifier thành hệ số nhân:

  • advance_booking_window, length_of_booking, start_day_of_week, start_date_range và device: Chỉ định hệ số từ 0.1 đến 10.0 (ví dụ: 1.5 cho mức điều chỉnh +50% hoặc 0.5 cho mức điều chỉnh -50%) hoặc đặt bid_modifier thành 0 (0.0) để chọn không sử dụng (-100%) tiêu chí.
  • user_set_dates: Chỉ định hệ số từ 0.5 đến 2.0. Việc đặt bid_modifier thành 0 không được hỗ trợ cho user_set_dates và trả về RangeError.TOO_LOW.

Để biết thêm thông tin chi tiết về cách hoạt động của từng loại mức điều chỉnh, hãy xem bài viết Giới thiệu về mức điều chỉnh giá thầu cho Quảng cáo khách sạn.

Các thông tin chi tiết sau đây về phân đoạn báo cáo và giới hạn tài nguyên cũng áp dụng cho phiên bản 26:

  • segments.user_set_dates: Trong phiên bản 26 trở lên, loại enum của segments.user_set_dates là DateSelectionType (được cập nhật từ HotelDateSelectionType trong phiên bản 25 trở xuống; báo cáo chiến dịch Khách sạn sử dụng segments.hotel_date_selection_type tiếp tục sử dụng HotelDateSelectionType). Các phân đoạn hành trình khác (segments.advance_booking_window, segments.length_of_booking, segments.start_date và segments.start_day_of_week) không thay đổi.
  • Giới hạn tài nguyên: ResourceLimitType.HOTEL_ADVANCE_BOOKING_WINDOW_BID_MODIFIERS_PER_AD_GROUP và ResourceLimitType.HOTEL_CHECK_IN_DATE_RANGE_BID_MODIFIERS_PER_AD_GROUP giữ nguyên tên hiện có trong phiên bản 26.

Java

private void runExample(GoogleAdsClient googleAdsClient, long customerId, long adGroupId) {
  List<AdGroupBidModifierOperation> operations = new ArrayList<>();

  // Constructs the ad group resource name to use for each bid modifier.
  String adGroupResourceName = ResourceNames.adGroup(customerId, adGroupId);

  // 1) Creates an ad group bid modifier based on the hotel check-in day.
  AdGroupBidModifier checkInDayAdGroupBidModifier =
      AdGroupBidModifier.newBuilder()
          // Sets the resource name to the ad group resource name joined with the criterion ID
          // whose value corresponds to the desired check-in day.
          .setAdGroup(adGroupResourceName)
          .setStartDayOfWeek(StartDayOfWeekInfo.newBuilder().setDayOfWeek(DayOfWeek.MONDAY))
          // Sets the bid modifier value to 150%.
          .setBidModifier(1.5d)
          .build();
  operations.add(
      AdGroupBidModifierOperation.newBuilder().setCreate(checkInDayAdGroupBidModifier).build());

  // 2) Creates an ad group bid modifier based on the hotel length of stay.
  AdGroupBidModifier lengthOfStayAdGroupBidModifier =
      AdGroupBidModifier.newBuilder()
          // Sets the ad group.
          .setAdGroup(adGroupResourceName)
          // Creates the length of booking info.
          .setLengthOfBooking(
              LengthOfBookingInfo.newBuilder().setMinDays(3L).setMaxDays(7L).build())
          // Sets the bid modifier value to 170%.
          .setBidModifier(1.7d)
          .build();
  operations.add(
      AdGroupBidModifierOperation.newBuilder().setCreate(lengthOfStayAdGroupBidModifier).build());

  // Issues a mutate request to add the ad group bid modifiers.
  try (AdGroupBidModifierServiceClient adGroupBidModifierServiceClient =
      googleAdsClient.getLatestVersion().createAdGroupBidModifierServiceClient()) {
    MutateAdGroupBidModifiersResponse response =
        adGroupBidModifierServiceClient.mutateAdGroupBidModifiers(
            Long.toString(customerId), operations);

    // Prints the resource names of the added ad group bid modifiers.
    System.out.printf("Added %d hotel ad group bid modifiers:%n", response.getResultsCount());
    for (MutateAdGroupBidModifierResult mutateAdGroupBidModifierResult :
        response.getResultsList()) {
      System.out.printf("  %s%n", mutateAdGroupBidModifierResult.getResourceName());
    }
  }
}
      

C#

public void Run(GoogleAdsClient client, long customerId, long adGroupId)
{
    // Get the AdGroupBidModifierService.
    AdGroupBidModifierServiceClient service = client.GetService(
        Services.V26.AdGroupBidModifierService);

    // Constructs the ad group resource name to use for each bid modifier.
    string adGroupResourceName = ResourceNames.AdGroup(customerId, adGroupId);

    // 1) Create an ad group bid modifier based on the hotel check-in day.
    AdGroupBidModifier checkInDayAdGroupBidModifier = new AdGroupBidModifier()
    {
        // Sets the resource name to the ad group resource name joined with the criterion
        // ID whose value corresponds to the desired check-in day.
        AdGroup = adGroupResourceName,
        StartDayOfWeek = new StartDayOfWeekInfo()
        {
            DayOfWeek = DayOfWeek.Monday
        },

        // Set the bid modifier value to 150%.
        BidModifier = 1.5,
    };

    // Creates an ad group bid modifier operation.
    var checkInDayAdGroupBidModifierOperation = new AdGroupBidModifierOperation()
    {
        Create = checkInDayAdGroupBidModifier
    };

    // 2) Create an ad group bid modifier based on the hotel length of stay.
    AdGroupBidModifier lengthOfStayAdGroupBidModifier = new AdGroupBidModifier()
    {
        // Set the ad group.
        AdGroup = ResourceNames.AdGroup(customerId, adGroupId),

        // Set the length of booking info.
        LengthOfBooking = new LengthOfBookingInfo()
        {
            MinDays = 3,
            MaxDays = 7
        },

        // Set the bid modifier value to 170%.
        BidModifier = 1.7
    };

    // Create an ad group bid modifier operation.
    var lengthOfStayAdGroupBidModifierOperation = new AdGroupBidModifierOperation()
    {
        Create = lengthOfStayAdGroupBidModifier
    };

    try
    {
        // Issue a mutate request to add an ad group bid modifiers.
        MutateAdGroupBidModifiersResponse response = service.MutateAdGroupBidModifiers(
            customerId.ToString(),
            new AdGroupBidModifierOperation[] {
      checkInDayAdGroupBidModifierOperation,
      lengthOfStayAdGroupBidModifierOperation
            }
        );

        // Display the resource names of the added ad group bid modifiers.
        Console.WriteLine($"Added {response.Results.Count} hotel ad group bid modifiers:");

        foreach (MutateAdGroupBidModifierResult result in response.Results)
        {
            Console.WriteLine($"- {result.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

    public static function runExample(
        GoogleAdsClient $googleAdsClient,
        int $customerId,
        int $adGroupId
    ) {
        $operations = [];

        // 1) Creates an ad group bid modifier based on the hotel check-in day.
        $checkInDayAdGroupBidModifier = new AdGroupBidModifier(
            [
            // Sets the ad group.
            'ad_group' => ResourceNames::forAdGroup($customerId, $adGroupId),
            'hotel_check_in_day' => new HotelCheckInDayInfo(
                [
                'day_of_week' => DayOfWeek::MONDAY
                ]
            ),
            // Sets the bid modifier value to 150%.
            'bid_modifier' => 1.5
            ]
        );

        // Creates an ad group bid modifier operation.
        $checkInDayAdGroupBidModifierOperation = new AdGroupBidModifierOperation();
        $checkInDayAdGroupBidModifierOperation->setCreate($checkInDayAdGroupBidModifier);
        $operations[] = $checkInDayAdGroupBidModifierOperation;

        // 2) Creates an ad group bid modifier based on the hotel length of stay.
        $lengthOfStayAdGroupBidModifier = new AdGroupBidModifier(
            [
            // Sets the ad group.
            'ad_group' => ResourceNames::forAdGroup($customerId, $adGroupId),
            // Creates the hotel length of stay info.
            'hotel_length_of_stay' => new HotelLengthOfStayInfo(
                [
                'min_nights' => 3,
                'max_nights' => 7,
                ]
            ),
            // Sets the bid modifier value to 170%.
            'bid_modifier' => 1.7
            ]
        );

        // Creates an ad group bid modifier operation.
        $lengthOfStayAdGroupBidModifierOperation = new AdGroupBidModifierOperation();
        $lengthOfStayAdGroupBidModifierOperation->setCreate(
            $lengthOfStayAdGroupBidModifier
        );
        $operations[] = $lengthOfStayAdGroupBidModifierOperation;

        // Issues a mutate request to add an ad group bid modifiers.
        $adGroupBidModifierServiceClient = $googleAdsClient->getAdGroupBidModifierServiceClient();
        $response = $adGroupBidModifierServiceClient->mutateAdGroupBidModifiers(
            MutateAdGroupBidModifiersRequest::build($customerId, $operations)
        );

        // Print out resource names of the added ad group bid modifiers.
        printf(
            "Added %d hotel ad group bid modifiers:%s",
            $response->getResults()->count(),
            PHP_EOL
        );
        foreach ($response->getResults() as $addedAdGroupBidModifier) {
            /**
 * @var AdGroupBidModifier $addedAdGroupBidModifier
*/
            print $addedAdGroupBidModifier->getResourceName() . PHP_EOL;
        }
    }
      

Python

def main(client: GoogleAdsClient, customer_id: str, ad_group_id: str) -> None:
    ad_group_service: AdGroupServiceClient = client.get_service(
        "AdGroupService"
    )
    ag_bm_service: AdGroupBidModifierServiceClient = client.get_service(
        "AdGroupBidModifierService"
    )

    # Create ad group bid modifier based on hotel check-in day.
    check_in_ag_bm_operation: AdGroupBidModifierOperation = client.get_type(
        "AdGroupBidModifierOperation"
    )
    check_in_ag_bid_modifier: AdGroupBidModifier = (
        check_in_ag_bm_operation.create
    )
    check_in_ag_bid_modifier.hotel_check_in_day.day_of_week = (
        client.enums.DayOfWeekEnum.MONDAY
    )
    check_in_ag_bid_modifier.ad_group = ad_group_service.ad_group_path(
        customer_id, ad_group_id
    )
    # Sets the bid modifier value to 150%.
    check_in_ag_bid_modifier.bid_modifier = 1.5

    # Create ad group bid modifier based on hotel length of stay info.
    los_ag_bm_operation: AdGroupBidModifierOperation = client.get_type(
        "AdGroupBidModifierOperation"
    )
    los_ag_bid_modifier: AdGroupBidModifier = los_ag_bm_operation.create
    los_ag_bid_modifier.ad_group = ad_group_service.ad_group_path(
        customer_id, ad_group_id
    )
    # Creates the hotel length of stay info.
    hotel_length_of_stay_info: HotelLengthOfStayInfo = (
        los_ag_bid_modifier.hotel_length_of_stay
    )
    hotel_length_of_stay_info.min_nights = 3
    hotel_length_of_stay_info.max_nights = 7
    # Sets the bid modifier value to 170%.
    los_ag_bid_modifier.bid_modifier = 1.7

    # Add the bid modifiers
    ag_bm_response: MutateAdGroupBidModifiersResponse = (
        ag_bm_service.mutate_ad_group_bid_modifiers(
            customer_id=customer_id,
            operations=[check_in_ag_bm_operation, los_ag_bm_operation],
        )
    )

    # Print out resource names of the added ad group bid modifiers.
    print(f"Added {len(ag_bm_response.results)} hotel ad group bid modifiers:")

    result: MutateAdGroupBidModifierResult
    for result in ag_bm_response.results:
        print(result.resource_name)
      

Ruby

def add_hotel_ad_group_bid_modifiers(customer_id, ad_group_id)
  # GoogleAdsClient will read a config file from
  # ENV['HOME']/google_ads_config.rb when called without parameters
  client = Google::Ads::GoogleAds::GoogleAdsClient.new
  operations = []
  ad_group_resource = client.path.ad_group(customer_id, ad_group_id)

  # 1) Creates an ad group bid modifier based on the check-in day.
  operations << client.operation.create_resource.ad_group_bid_modifier do |bm|
    # Sets the ad group.
    bm.ad_group = ad_group_resource

    # Sets the check-in day to Monday.
    bm.start_day_of_week = client.resource.start_day_of_week_info do |info|
      info.day_of_week = :MONDAY
    end

    # Sets the bid modifier value to 150%.
    bm.bid_modifier = 1.5
  end

  # 2) Creates an ad group bid modifier based on the length of booking.
  operations << client.operation.create_resource.ad_group_bid_modifier do |bm|
    # Sets the ad group.
    bm.ad_group = ad_group_resource

    # Creates the length of booking info.
    bm.length_of_booking = client.resource.length_of_booking_info do |info|
      info.min_days = 3
      info.max_days = 7
    end

    # Sets the bid modifier value to 170%.
    bm.bid_modifier = 1.7
  end

  # 3) Issues a mutate request to add an ad group bid modifiers.
  ad_group_bid_modifier_service = client.service.ad_group_bid_modifier
  response = ad_group_bid_modifier_service.mutate_ad_group_bid_modifiers(
    customer_id: customer_id,
    operations: operations,
  )

  # Print out resource names of the added ad group bid modifiers.
  puts "Added #{response.results.size} hotel ad group bid modifiers:"
  response.results.each do |added_ad_group_bid_modifier|
    puts "\t#{added_ad_group_bid_modifier.resource_name}"
  end
end
      

Perl

sub add_hotel_ad_group_bid_modifiers {
  my ($api_client, $customer_id, $ad_group_id) = @_;

  # 1) Create an ad group bid modifier based on the hotel check-in day.
  my $check_in_day_ad_group_bid_modifier =
    Google::Ads::GoogleAds::V26::Resources::AdGroupBidModifier->new({
      # Set the ad group.
      adGroup => Google::Ads::GoogleAds::V26::Utils::ResourceNames::ad_group(
        $customer_id, $ad_group_id
      ),
      hotelCheckInDay =>
        Google::Ads::GoogleAds::V26::Common::HotelCheckInDayInfo->new({
          dayOfWeek => MONDAY
        }
        ),
      # Set the bid modifier value to 150%.
      bidModifier => 1.5
    });

  # Create an ad group bid modifier operation.
  my $check_in_day_ad_group_bid_modifier_operation =
    Google::Ads::GoogleAds::V26::Services::AdGroupBidModifierService::AdGroupBidModifierOperation
    ->new({
      create => $check_in_day_ad_group_bid_modifier
    });

  # 2) Create an ad group bid modifier based on the hotel length of stay.
  my $length_of_stay_ad_group_bid_modifier =
    Google::Ads::GoogleAds::V26::Resources::AdGroupBidModifier->new({
      # Set the ad group.
      adGroup => Google::Ads::GoogleAds::V26::Utils::ResourceNames::ad_group(
        $customer_id, $ad_group_id
      ),
      # Create the hotel length of stay info.
      hotelLengthOfStay =>
        Google::Ads::GoogleAds::V26::Common::HotelLengthOfStayInfo->new({
          minNights => 3,
          maxNights => 7
        }
        ),
      # Set the bid modifier value to 170%.
      bidModifier => 1.7
    });

  # Create an ad group bid modifier operation.
  my $length_of_stay_ad_group_bid_modifier_operation =
    Google::Ads::GoogleAds::V26::Services::AdGroupBidModifierService::AdGroupBidModifierOperation
    ->new({
      create => $length_of_stay_ad_group_bid_modifier
    });

  # 3) Add the ad group bid modifiers.
  my $ad_group_bid_modifiers_response =
    $api_client->AdGroupBidModifierService()->mutate({
      customerId => $customer_id,
      operations => [
        $check_in_day_ad_group_bid_modifier_operation,
        $length_of_stay_ad_group_bid_modifier_operation
      ]});

  # Print out resource names of the added ad group bid modifiers.
  my $ad_group_bid_modifier_results =
    $ad_group_bid_modifiers_response->{results};
  printf "Added %d hotel ad group bid modifiers:\n",
    scalar @$ad_group_bid_modifier_results;

  foreach my $ad_group_bid_modifier_result (@$ad_group_bid_modifier_results) {
    printf "\t%s\n", $ad_group_bid_modifier_result->{resourceName};
  }

  return 1;
}
      

curl

Ví dụ

Các ví dụ sau đây cho thấy cách truy vấn, tạo, cập nhật và xoá hệ số điều chỉnh giá thầu của nhóm quảng cáo bằng cách sử dụng GAQL và tải trọng JSON REST.

Đọc hệ số điều chỉnh giá thầu bằng GAQL

Các truy vấn sau đây minh hoạ cách truy xuất hệ số điều chỉnh giá thầu theo thời gian đặt phòng trong phiên bản 25 trở xuống so với phiên bản 26 trở lên:

Phiên bản 25 trở xuống:

SELECT
  ad_group_bid_modifier.resource_name,
  ad_group_bid_modifier.bid_modifier,
  ad_group_bid_modifier.hotel_length_of_stay.min_nights,
  ad_group_bid_modifier.hotel_length_of_stay.max_nights
FROM ad_group_bid_modifier
WHERE ad_group_bid_modifier.hotel_length_of_stay.min_nights = 5

v26 trở lên:

SELECT
  ad_group_bid_modifier.resource_name,
  ad_group_bid_modifier.bid_modifier,
  ad_group_bid_modifier.length_of_booking.min_days,
  ad_group_bid_modifier.length_of_booking.max_days
FROM ad_group_bid_modifier
WHERE ad_group_bid_modifier.length_of_booking.min_days = 5

Tạo hệ số điều chỉnh giá thầu (tải trọng JSON)

Tải trọng JSON sau đây minh hoạ cách tạo hệ số điều chỉnh giá thầu nhóm quảng cáo trong phiên bản 26 trở lên.

Tạo hệ số điều chỉnh giá thầu theo thời lượng đặt phòng trong phiên bản 26:

{
  "customerId": "1234567890",
  "operations": [
    {
      "create": {
        "adGroup": "customers/1234567890/adGroups/987654321",
        "bidModifier": 1.2,
        "lengthOfBooking": {
          "minDays": "3",
          "maxDays": "5"
        }
      }
    }
  ]
}

Trong phiên bản 25 trở xuống, phương thức này sử dụng hotelLengthOfStay với minNights và maxNights.

Tạo hệ số điều chỉnh giá thầu theo phạm vi ngày bắt đầu trong phiên bản 26:

{
  "customerId": "1234567890",
  "operations": [
    {
      "create": {
        "adGroup": "customers/1234567890/adGroups/987654321",
        "bidModifier": 1.5,
        "startDateRange": {
          "startDate": "2026-12-20",
          "endDate": "2026-12-31"
        }
      }
    }
  ]
}

Tạo hệ số điều chỉnh giá thầu theo ngày do người dùng đặt trong phiên bản 26:

{
  "customerId": "1234567890",
  "operations": [
    {
      "create": {
        "adGroup": "customers/1234567890/adGroups/987654321",
        "bidModifier": 1.3,
        "userSetDates": {
          "type": "USER_SELECTED"
        }
      }
    }
  ]
}

Cập nhật và xoá hệ số điều chỉnh giá thầu

Bạn có thể cập nhật hệ số trên hệ số điều chỉnh giá thầu hiện có hoặc xoá hoàn toàn hệ số điều chỉnh giá thầu:

  • Đang cập nhật: Các trường tiêu chí là IMMUTABLE. Để sửa đổi hệ số giá thầu, hãy gửi một thao tác update có updateMask (update_mask trong protobuf) được đặt thành "bidModifier" ("bid_modifier") và đặt bidModifier (bid_modifier) thành một giá trị hợp lệ (0.1 thành 10.0 hoặc 0 để chọn không sử dụng cho advance_booking_window, length_of_booking, start_day_of_week, start_date_range và device; 0.5 thành 2.0 cho user_set_dates). Để thay đổi tiêu chí nhắm mục tiêu, hãy xoá hệ số điều chỉnh giá thầu rồi tạo một hệ số mới.
  • Xoá: Gửi thao tác remove có tên tài nguyên:
{
  "customerId": "1234567890",
  "operations": [
    {
      "remove": "customers/1234567890/adGroupBidModifiers/987654321~555444333"
    }
  ]
}

Quy tắc xác thực và xử lý lỗi

Quy tắc xác thực vẫn giữ nguyên trên các phiên bản, nhưng 6 giá trị enum CriterionError được đổi tên trong phiên bản 26 như trong bảng sau:

Trường hợp v25 trở xuống phiên bản 26 trở lên
Khoảng thời lượng đặt phòng trùng lặp với tiêu chí hiện có HOTEL_LENGTH_OF_STAY_OVERLAPS_WITH_EXISTING_CRITERION LENGTH_OF_BOOKING_OVERLAPS_WITH_EXISTING_CRITERION
Phạm vi thời hạn đặt trước trùng lặp với tiêu chí hiện có HOTEL_ADVANCE_BOOKING_WINDOW_OVERLAPS_WITH_EXISTING_CRITERION ADVANCE_BOOKING_WINDOW_OVERLAPS_WITH_EXISTING_CRITERION
Phạm vi ngày bắt đầu trùng lặp với tiêu chí hiện có HOTEL_CHECK_IN_DATE_RANGE_OVERLAPS_WITH_EXISTING_CRITERION START_DATE_RANGE_OVERLAPS_WITH_EXISTING_CRITERION
start_date trước hôm qua (UTC) HOTEL_CHECK_IN_DATE_RANGE_START_DATE_TOO_EARLY START_DATE_RANGE_START_DATE_TOO_EARLY
end_date hơn 330 ngày trong tương lai (UTC) HOTEL_CHECK_IN_DATE_RANGE_END_DATE_TOO_LATE START_DATE_RANGE_END_DATE_TOO_LATE
start_date sau khi end_date HOTEL_CHECK_IN_DATE_RANGE_REVERSED START_DATE_RANGE_REVERSED

Các lỗi xác thực sau đây áp dụng cho tất cả phiên bản API:

  • FieldError.REQUIRED: Thiếu ranh giới bắt buộc của phạm vi (chẳng hạn như advance_booking_window mà không có min_days hoặc max_days).
  • RangeError.TOO_HIGH / RangeError.TOO_LOW: Giá trị nằm ngoài giới hạn, chẳng hạn như advance_booking_window.max_days lớn hơn 330, min_days lớn hơn max_days trên advance_booking_window hoặc length_of_booking, bid_modifier nằm ngoài khoảng 0.1–10.0 đối với advance_booking_window, length_of_booking, start_day_of_week hoặc start_date_range, hoặc bid_modifier nằm ngoài khoảng 0.5–2.0 (bao gồm cả 0) đối với user_set_dates.
  • ResourceCountLimitExceededError.RESOURCE_LIMIT: Nhóm quảng cáo vượt quá giới hạn về hệ số điều chỉnh giá thầu cho mỗi nhóm quảng cáo.
  • MutateError.INCONSISTENT_FIELD_VALUES: Trường con enum có mã cố định (chẳng hạn như user_set_dates.type, start_day_of_week.day_of_week hoặc device.type) không khớp với mã tiêu chí được chỉ định trong resource_name.
  • ContextError.OPERATION_NOT_PERMITTED_FOR_CONTEXT: Đang cố gắng thêm hệ số điều chỉnh giá thầu du lịch vào một loại chiến dịch không được hỗ trợ hoặc chiến dịch Tìm kiếm không đủ điều kiện.