হোটেল লিস্টিং গ্রুপ তৈরি করা

ভিডিও: 2019 ওয়ার্কশপ থেকে লিস্টিং গ্রুপ টক দেখুন

হোটেল বিজ্ঞাপন গোষ্ঠীগুলি একাধিক মাত্রা জুড়ে আপনার হোটেলগুলিকে অনেকগুলি হোটেল তালিকা গোষ্ঠীতে বিভক্ত করতে সহায়তা করে যাতে আপনি সেই অনুযায়ী প্রতিটি গ্রুপের জন্য বিডগুলি সামঞ্জস্য করতে পারেন৷ নীচের গাছটি বিবেচনা করুন, যেখানে প্রথম স্তরে, হোটেলগুলিকে বিস্তৃতভাবে 5-তারা হোটেল, 4-তারকা হোটেল এবং অন্যান্য হোটেল শ্রেণী হিসাবে বিভক্ত করা হয়েছে। দ্বিতীয় স্তরে, অন্যান্য হোটেল শ্রেণীর হোটেলগুলিকে "মার্কিন যুক্তরাষ্ট্র" হোটেল, "ইউনাইটেড কিংডম" হোটেল এবং অন্যান্য অঞ্চলের হোটেল হিসাবে ভাগ করা হয়েছে।

গাছের প্রতিটি নোড হয় একটি উপবিভাগ বা একটি ইউনিট, যেমনটি ListingGroupType দ্বারা সংজ্ঞায়িত করা হয়েছে। একটি উপবিভাগ গাছে একটি নতুন স্তর প্রবর্তন করে, যখন ইউনিটগুলি গাছের পাতা। প্রতিটি সাবডিভিশন অবশ্যই সম্পূর্ণভাবে বিভাজন করা উচিত, তাই এটিতে অবশ্যই অন্যান্য প্রতিনিধিত্বকারী একটি নোড থাকতে হবে। উদাহরণে, রুট এবং হোটেল ক্লাস: (অন্যান্য) নোডগুলি উপবিভাগ। উপবিভাগ এবং ইউনিট সহ এই গাছের কাঠামো আপনাকে ইউনিট স্তরে বিড সেট করতে দেয় এবং এটিও নিশ্চিত করে যে প্রতিটি হোটেল তালিকা গাছের মধ্যে একটি এবং শুধুমাত্র একটি ইউনিট নোডে পড়ে।

নোডগুলি হল ListingGroupInfo ক্লাসের অবজেক্ট, যেটিতে ListingGroupType ক্ষেত্র রয়েছে যা নির্দেশ করে যে নোডগুলি একক বা উপবিভাগ কিনা। AdGroupCriterion এর listing_groupListingGroupInfo সেট করা হলে তা AdGroup সাথে লিঙ্ক করবে।

শতাংশ সিপিসি বিড সেট করা

আপনাকে শুধুমাত্র ইউনিট নোডগুলিতে AdGroupCriterion এর percent_cpc_bid_micros সেট করার অনুমতি দেওয়া হয়েছে। সাবডিভিশন নোডগুলিতে এটি করার প্রচেষ্টা একটি ত্রুটির সাথে ব্যর্থ হবে৷

তালিকার মাত্রা

একটি ListingGroupInfo একটি case_value ও থাকে যা একটি ListingDimensionInfo যাতে বিভিন্ন মাত্রার একটি থাকে। একটি ListingGroupInfo আপনার হোটেলের সাথে সম্পর্কিত মানগুলিকে প্রতিনিধিত্ব করে, যেমন হোটেল আইডি, হোটেলের দেশ বা হোটেল ক্লাস। রেফারেন্স ডকুমেন্টেশনে উপলব্ধ ListingDimensionInfo প্রকারের একটি সম্পূর্ণ বিবরণ পাওয়া যায়।

একটি উপবিভাগের প্রতিটি তাত্ক্ষণিক শিশুর অবশ্যই একই ListingDimensionInfo সাবটাইপের একটি case_value থাকতে হবে। শুধুমাত্র রুট নোডের একটি case_value নেই।

মনে রাখবেন যে প্রতিটি সাবডিভিশনে অবশ্যই একটি "খালি" case_value থাকতে হবে, যা "অন্য সমস্ত মান" উপস্থাপন করে।

আরও বিশদ বিবরণের জন্য, নিম্নলিখিত কোড স্নিপেটটি দেখুন যা তালিকা গ্রুপ ট্রির প্রথম স্তর যুক্ত করে।

জাভা

private static String addLevel1Nodes(
    long customerId,
    long adGroupId,
    String rootResourceName,
    List<AdGroupCriterionOperation> operations,
    long percentCpcBidMicroAmount) {
  // Creates hotel class info and dimension info for 5-star hotels.
  ListingDimensionInfo fiveStarredDimensionInfo =
      ListingDimensionInfo.newBuilder()
          .setHotelClass(HotelClassInfo.newBuilder().setValue(5).build())
          .build();
  // Creates listing group info for 5-star hotels as a UNIT node.
  ListingGroupInfo fiveStarredUnit =
      ListingGroupInfo.newBuilder()
          .setType(ListingGroupType.UNIT)
          .setParentAdGroupCriterion(rootResourceName)
          .setCaseValue(fiveStarredDimensionInfo)
          .build();
  // Creates an ad group criterion for 5-star hotels.
  AdGroupCriterion fiveStarredAdGroupCriterion =
      createAdGroupCriterion(customerId, adGroupId, fiveStarredUnit, percentCpcBidMicroAmount);
  // Decrements the temp ID for the next ad group criterion.
  AdGroupCriterionOperation operation = generateCreateOperation(fiveStarredAdGroupCriterion);
  operations.add(operation);

  // You can also create more UNIT nodes for other hotel classes by copying the above code in
  // this method and modifying the value passed to HotelClassInfo() to the value you want.
  // For instance, passing 4 instead of 5 in the above code will create a UNIT node of 4-star
  // hotels instead.

  // Creates hotel class info and dimension info for other hotel classes by not specifying
  // any attributes on those object.
  ListingDimensionInfo otherHotelsDimensionInfo =
      ListingDimensionInfo.newBuilder()
          .setHotelClass(HotelClassInfo.newBuilder().build())
          .build();
  // Creates listing group info for other hotel classes as a SUBDIVISION node, which will be
  // used as a parent node for children nodes of the next level.
  ListingGroupInfo otherHotelsSubdivision =
      createListingGroupInfo(
          ListingGroupType.SUBDIVISION, rootResourceName, otherHotelsDimensionInfo);
  // Creates an ad group criterion for other hotel classes.
  AdGroupCriterion otherHotelsAdGroupCriterion =
      createAdGroupCriterion(
          customerId, adGroupId, otherHotelsSubdivision, percentCpcBidMicroAmount);
  operation = generateCreateOperation(otherHotelsAdGroupCriterion);
  operations.add(operation);

  return otherHotelsAdGroupCriterion.getResourceName();
}
      

সি#

private string AddLevel1Nodes(long customerId, long adGroupId, string rootResourceName,
    List<AdGroupCriterionOperation> operations, long percentCpcBidMicroAmount)
{
    // Create listing dimension info for 5-star class hotels.
    ListingDimensionInfo fiveStarredListingDimensionInfo = new ListingDimensionInfo
    {
        HotelClass = new HotelClassInfo
        {
            Value = 5
        }
    };

    // Create a listing group info for 5-star hotels as a UNIT node.
    ListingGroupInfo fiveStarredUnit = CreateListingGroupInfo(ListingGroupType.Unit,
        rootResourceName, fiveStarredListingDimensionInfo);

    // Create an ad group criterion for 5-star hotels.
    AdGroupCriterion fiveStarredAdGroupCriterion = CreateAdGroupCriterion(customerId,
        adGroupId, fiveStarredUnit, percentCpcBidMicroAmount);

    // Create an operation and add it to the list of operations.
    operations.Add(new AdGroupCriterionOperation
    {
        Create = fiveStarredAdGroupCriterion
    });

    // Decrement the temp ID for the next ad group criterion.
    nextTempId--;

    // You can also create more UNIT nodes for other hotel classes by copying the above code
    // in this method and modifying the value passed to HotelClassInfo().
    // For instance, passing 4 instead of 5 in the above code will instead create a UNIT
    // node of 4-star hotels.

    // Create hotel class info and dimension info for other hotel classes by *not*
    // specifying any attributes on those object.
    ListingDimensionInfo otherHotelsListingDimensionInfo = new ListingDimensionInfo
    {
        HotelClass = new HotelClassInfo()
    };

    // Create listing group info for other hotel classes as a SUBDIVISION node, which will
    // be used as a parent node for children nodes of the next level.
    ListingGroupInfo otherHotelsSubdivisionListingGroupInfo = CreateListingGroupInfo
        (ListingGroupType.Subdivision, rootResourceName, otherHotelsListingDimensionInfo);

    // Create an ad group criterion for other hotel classes.
    AdGroupCriterion otherHotelsAdGroupCriterion = CreateAdGroupCriterion(customerId,
        adGroupId, otherHotelsSubdivisionListingGroupInfo, percentCpcBidMicroAmount);

    // Create an operation and add it to the list of operations.
    operations.Add(new AdGroupCriterionOperation
    {
        Create = otherHotelsAdGroupCriterion
    });

    // Decrement the temp ID for the next ad group criterion.
    nextTempId--;

    return otherHotelsAdGroupCriterion.ResourceName;
}
      

পিএইচপি

private static function addLevel1Nodes(
    int $customerId,
    int $adGroupId,
    string $rootResourceName,
    array &$operations,
    int $percentCpcBidMicroAmount
) {
    // Creates hotel class info and dimension info for 5-star hotels.
    $fiveStarredDimensionInfo = new ListingDimensionInfo([
        'hotel_class' => new HotelClassInfo(['value' => 5])
    ]);
    // Creates listing group info for 5-star hotels as a UNIT node.
    $fiveStarredUnit = self::createListingGroupInfo(
        ListingGroupType::UNIT,
        $rootResourceName,
        $fiveStarredDimensionInfo
    );
    // Creates an ad group criterion for 5-star hotels.
    $fiveStarredAdGroupCriterion = self::createAdGroupCriterion(
        $customerId,
        $adGroupId,
        $fiveStarredUnit,
        $percentCpcBidMicroAmount
    );
    // Decrements the temp ID for the next ad group criterion.
    self::$nextTempId--;
    $operation = self::generateCreateOperation($fiveStarredAdGroupCriterion);
    $operations[] = $operation;

    // You can also create more UNIT nodes for other hotel classes by copying the above code in
    // this method and modifying the value passed to HotelClassInfo() to the value you want.
    // For instance, passing 4 instead of 5 in the above code will create a UNIT node of 4-star
    // hotels instead.

    // Creates hotel class info and dimension info for other hotel classes by *not* specifying
    // any attributes on those object.
    $othersHotelsDimensionInfo = new ListingDimensionInfo([
        'hotel_class' => new HotelClassInfo()
    ]);
    // Creates listing group info for other hotel classes as a SUBDIVISION node, which will be
    // used as a parent node for children nodes of the next level.
    $otherHotelsSubDivision = self::createListingGroupInfo(
        ListingGroupType::SUBDIVISION,
        $rootResourceName,
        $othersHotelsDimensionInfo
    );
    // Creates an ad group criterion for other hotel classes.
    $otherHotelsAdGroupCriterion = self::createAdGroupCriterion(
        $customerId,
        $adGroupId,
        $otherHotelsSubDivision,
        $percentCpcBidMicroAmount
    );
    $operation = self::generateCreateOperation($otherHotelsAdGroupCriterion);
    $operations[] = $operation;

    self::$nextTempId--;
    return $otherHotelsAdGroupCriterion->getResourceName();
}
      

পাইথন

def add_level1_nodes(
    client,
    customer_id,
    ad_group_id,
    root_resource_name,
    operations,
    percent_cpc_bid_micro_amount,
):
    """Creates child nodes on level 1, partitioned by the hotel class info.

    Args:
        client: The Google Ads API client.
        customer_id: The Google Ads customer ID.
        ad_group_id: The ad group ID to which the hotel listing group will be
            added.
        root_resource_name: The string resource name of the listing group's root
            node.
        operations: A list of AdGroupCriterionOperations.
        percent_cpc_bid_micro_amount: The CPC bid micro amount to be set on
            created ad group criteria.

    Returns:
        The string resource name of the "other hotel classes" node, which serves
        as the parent node for the next level of the listing tree.
    """
    global next_temp_id

    # Create listing dimension info for 5-star class hotels.
    five_starred_listing_dimension_info = client.get_type(
        "ListingDimensionInfo"
    )
    five_starred_listing_dimension_info.hotel_class.value = 5

    # Create a listing group info for 5-star hotels as a UNIT node.
    five_starred_unit = create_listing_group_info(
        client,
        client.enums.ListingGroupTypeEnum.UNIT,
        root_resource_name,
        five_starred_listing_dimension_info,
    )

    # Create an ad group criterion for 5-star hotels.
    five_starred_ad_group_criterion = create_ad_group_criterion(
        client,
        customer_id,
        ad_group_id,
        five_starred_unit,
        percent_cpc_bid_micro_amount,
    )

    # Create an operation and add it to the list of operations.
    five_starred_ad_group_criterion_operation = client.get_type(
        "AdGroupCriterionOperation"
    )
    client.copy_from(
        five_starred_ad_group_criterion_operation.create,
        five_starred_ad_group_criterion,
    )
    operations.append(five_starred_ad_group_criterion_operation)

    # Decrement the temp ID for the next ad group criterion.
    next_temp_id -= 1

    # You can also create more UNIT nodes for other hotel classes by copying the
    # above code in this method and modifying the hotel class value.
    # For instance, passing 4 instead of 5 in the above code will instead create
    # a UNIT node of 4-star hotels.

    # Create hotel class info and dimension info without any specifying
    # attributes. This node will then represent hotel classes other than those
    # already covered by UNIT nodes at this level.
    other_hotels_listing_dimension_info = client.get_type(
        "ListingDimensionInfo"
    )
    # Set "hotel_class" as the oneof field on the ListingDimensionInfo object
    # without specifying the optional hotel_class field.
    client.copy_from(
        other_hotels_listing_dimension_info.hotel_class,
        client.get_type("HotelClassInfo"),
    )

    # Create listing group info for other hotel classes as a SUBDIVISION node,
    # which will be used as a parent node for children nodes of the next level.
    other_hotels_subdivision_listing_group_info = create_listing_group_info(
        client,
        client.enums.ListingGroupTypeEnum.SUBDIVISION,
        root_resource_name,
        other_hotels_listing_dimension_info,
    )

    # Create an ad group criterion for other hotel classes.
    other_hotels_ad_group_criterion = create_ad_group_criterion(
        client,
        customer_id,
        ad_group_id,
        other_hotels_subdivision_listing_group_info,
        percent_cpc_bid_micro_amount,
    )

    # Create an operation and add it to the list of operations.
    other_hotels_ad_group_criterion_operation = client.get_type(
        "AdGroupCriterionOperation"
    )
    client.copy_from(
        other_hotels_ad_group_criterion_operation.create,
        other_hotels_ad_group_criterion,
    )
    operations.append(other_hotels_ad_group_criterion_operation)

    # Decrement the temp ID for the next ad group criterion.
    next_temp_id -= 1

    return other_hotels_ad_group_criterion.resource_name
      

রুবি

def add_level1_nodes(
  client,
  customer_id,
  ad_group_id,
  root_resource_name,
  operations,
  percent_cpc_bid_micro_amount)
  # Creates hotel class info and dimension info for 5-star hotels.
  five_starred_dimension_info = client.resource.listing_dimension_info do |d|
    d.hotel_class = client.resource.hotel_class_info do |c|
      c.value = 5
    end
  end

  # Creates listing group info for 5-star hotels as a UNIT node.
  five_starred_unit = create_listing_group_info(
    client,
    :UNIT,
    root_resource_name,
    five_starred_dimension_info,
  )

  # Creates an ad group criterion for 5-star hotels.
  five_starred_ad_group_criterion = create_ad_group_criterion(
    client,
    customer_id,
    ad_group_id,
    five_starred_unit,
    percent_cpc_bid_micro_amount,
  )

  operations << generate_create_operation(
    client,
    five_starred_ad_group_criterion,
  )

  # You can also create more UNIT nodes for other hotel classes by copying the
  # above code in this method and modifying the value passed to HotelClassInfo()
  # to the value you want.
  # For instance, passing 4 instead of 5 in the above code will create a UNIT
  # node of 4-star hotels instead.

  # Creates hotel class info and dimension info for other hotel classes
  # by *not* specifying any attributes on those object.
  other_hotels_dimention_info = client.resource.listing_dimension_info do |d|
    d.hotel_class = client.resource.hotel_class_info
  end

  # Creates listing group info for other hotel classes as a SUBDIVISION node,
  # which will be used as a parent node for children nodes of the next level.
  other_hotels_subdivision = create_listing_group_info(
    client,
    :SUBDIVISION,
    root_resource_name,
    other_hotels_dimention_info,
  )

  # Creates an ad group criterion for other hotel classes.
  other_hotels_ad_group_criterion = create_ad_group_criterion(
    client,
    customer_id,
    ad_group_id,
    other_hotels_subdivision,
    percent_cpc_bid_micro_amount,
  )

  operations << generate_create_operation(
    client,
    other_hotels_ad_group_criterion,
  )

  other_hotels_ad_group_criterion.resource_name
end
      

পার্ল

sub add_level_1_nodes {
  my ($customer_id, $ad_group_id, $root_resource_name, $operations,
    $percent_cpc_bid_micro_amount)
    = @_;

  # Create hotel class info and dimension info for 5-star hotels.
  my $five_starred_dimension_info =
    Google::Ads::GoogleAds::V16::Common::ListingDimensionInfo->new({
      hotelClass => Google::Ads::GoogleAds::V16::Common::HotelClassInfo->new({
          value => 5
        })});

  # Create listing group info for 5-star hotels as a UNIT node.
  my $five_starred_unit = create_listing_group_info(UNIT, $root_resource_name,
    $five_starred_dimension_info);

  # Create an ad group criterion for 5-star hotels.
  my $five_starred_ad_group_criterion =
    create_ad_group_criterion($customer_id, $ad_group_id, $five_starred_unit,
    $percent_cpc_bid_micro_amount);

  my $operation = generate_create_operation($five_starred_ad_group_criterion);
  push @$operations, $operation;

  # You can also create more UNIT nodes for other hotel classes by copying the
  # above code in this method and modifying the value passed to HotelClassInfo
  # to the value you want. For instance, passing 4 instead of 5 in the above code
  #  will create a UNIT node of 4-star hotels instead.

  # Create hotel class info and dimension info for other hotel classes by *not*
  # specifying any attributes on those object.
  my $others_hotels_dimension_info =
    Google::Ads::GoogleAds::V16::Common::ListingDimensionInfo->new({
      hotelClass => Google::Ads::GoogleAds::V16::Common::HotelClassInfo->new()}
    );

  # Create listing group info for other hotel classes as a SUBDIVISION node, which
  # will be used as a parent node for children nodes of the next level.
  my $other_hotels_subdivision =
    create_listing_group_info(SUBDIVISION, $root_resource_name,
    $others_hotels_dimension_info);

  # Create an ad group criterion for other hotel classes.
  my $other_hotels_ad_group_criterion =
    create_ad_group_criterion($customer_id, $ad_group_id,
    $other_hotels_subdivision, $percent_cpc_bid_micro_amount);

  $operation = generate_create_operation($other_hotels_ad_group_criterion);
  push @$operations, $operation;

  return $other_hotels_ad_group_criterion->{resourceName};
}
      

ListingDimensionInfo এর জন্য উপলব্ধ মাত্রা

হোটেল বিজ্ঞাপনের জন্য নিম্নলিখিত ListingDimensionInfo মাত্রা তথ্যের ধরন উপলব্ধ:

অস্থায়ী আইডি

বিজ্ঞাপন গোষ্ঠীর মানদণ্ড আইডি বরাদ্দ করা হয় না যতক্ষণ না তাদের তৈরি করা মিউটেট অনুরোধ সার্ভার দ্বারা প্রক্রিয়া করা হয়। যাইহোক, একটি ListingGroupInfo সম্পূর্ণ না হওয়া পর্যন্ত অবৈধ, তাই যখনই আপনি একটি উপবিভাগ তৈরি করবেন আপনাকে অবশ্যই একই ক্রিয়াকলাপে এর অন্তত একটি শিশু তৈরি করতে হবে।

চাইল্ড নোডের জন্য ListingGroupInfo এর parent_ad_group_criterion সেট করার জন্য, আপনি অস্থায়ী মানদণ্ড আইডি ব্যবহার করতে পারেন। এগুলি স্থানীয়ভাবে অনন্য (বিশ্বব্যাপী অনন্য নয়) শনাক্তকারী যা শুধুমাত্র একটি মিউটেট অনুরোধের প্রসঙ্গে প্রযোজ্য। যেকোনো নেতিবাচক পূর্ণসংখ্যা (উদাহরণস্বরূপ, -1 ) একটি অস্থায়ী আইডি হিসাবে ব্যবহার করা যেতে পারে।

যখন অনুরোধটি প্রক্রিয়া করা হয়, প্রতিটি AdGroupCriterion যথারীতি একটি ইতিবাচক গ্লোবাল আইডি বরাদ্দ করা হয়।