অবস্থান সম্পদ

অন্যান্য অ্যাসেটের বিপরীতে, আপনি একটি অ্যাসেট সেট তৈরি করার পরে Google Ads API দ্বারা লোকেশন অ্যাসেটগুলি স্বয়ংক্রিয়ভাবে তৈরি হয়। প্রথমে, একটি লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করুন এবং এটি গ্রাহকের সাথে সংযুক্ত করুন। তারপর, যদি আপনাকে কোনও ক্যাম্পেইন বা বিজ্ঞাপন গ্রুপের জন্য অ্যাসেট সেটে লোকেশন অ্যাসেটের একটি উপসেট নির্বাচন করতে হয়, তাহলে একটি লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করুন এবং এটি ক্যাম্পেইন বা বিজ্ঞাপন গ্রুপের সাথে সংযুক্ত করুন।

একটি লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করুন এবং এটি গ্রাহকের সাথে সংযুক্ত করুন।

  1. একটি লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করুন
  2. CustomerAssetSetService ব্যবহার করে এটি একজন গ্রাহকের সাথে সংযুক্ত করুন

একটি লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করুন

  1. একটি নতুন AssetSet তৈরি করুন।
    1. type LOCATION_SYNC তে সেট করুন।
    2. location_set একটি নতুন LocationSet এ সেট করুন।
  2. নতুন LocationSet এ,

    1. আপনার ব্যবহারের ক্ষেত্রের উপর ভিত্তি করে location_ownership_type সেট করুন:
      • যদি আপনার ব্যবসার অবস্থানটি থাকে, তাহলে এটিকে BUSINESS_OWNER এ সেট করুন।
      • যদি আপনার ব্যবসার অবস্থানটি না থাকে, কিন্তু সেখানে আপনার পণ্য বিক্রি করেন, তাহলে এটিকে AFFILIATE এ সেট করুন।
    2. আপনার ব্যবহারের ক্ষেত্রের উপর ভিত্তি করে source oneof ফিল্ড সেট করুন:

      • আপনার Google Business Profile অ্যাকাউন্টে আপনার অবস্থানের সাথে সিঙ্ক করতে চাইলে business_profile_location_set সেট করুন।

        যখন আপনি একটি BusinessProfileLocationSet তৈরি করেন যাতে Google Ads একটি Google Business Profile অ্যাকাউন্টের সাথে লিঙ্ক করা যায়, তখন আপনাকে http_authorization_token ফিল্ডে একটি OAuth 2.0 অ্যাক্সেস টোকেন প্রদান করতে হবে। এই টোকেনটি প্রমাণ হিসেবে কাজ করে যে আপনি নির্দিষ্ট Google Business Profile থেকে অবস্থানের ডেটা অ্যাক্সেস করার জন্য Google Ads কে অনুমোদন দিচ্ছেন।

        টোকেনটি অবশ্যই এই প্রয়োজনীয়তাগুলি পূরণ করবে:

        • এটি অবশ্যই সেই Google অ্যাকাউন্টের (ব্যবহারকারী বা পরিষেবা অ্যাকাউন্ট) জন্য তৈরি করতে হবে যার ইমেল ঠিকানা BusinessProfileLocationSet এর email_address ক্ষেত্রে দেওয়া আছে।
        • এই অ্যাকাউন্টের Google Business Profile-এর মধ্যে ব্যবসার অবস্থানগুলি পড়ার জন্য পর্যাপ্ত অনুমতি থাকতে হবে।
        • OAuth 2.0 টোকেনটি https://www.googleapis.com/auth/business.manage স্কোপের মাধ্যমে পেতে হবে।

        OAuth 2.0 অ্যাক্সেস টোকেন কীভাবে তৈরি করবেন সে সম্পর্কে বিস্তারিত নির্দেশাবলীর জন্য, Google API অ্যাক্সেস করতে OAuth 2.0 ব্যবহার দেখুন।

      • নির্দিষ্ট চেইন আইডিতে অবস্থানের সাথে সিঙ্ক করতে চাইলে chain_location_set সেট করুন।

      • যদি আপনি প্লেস আইডি ব্যবহার করে ম্যানুয়ালি লোকেশন যোগ করতে চান, তাহলে maps_location_set সেট করুন।

এই ধাপগুলি সম্পন্ন করার পরে, Google Ads API লোকেশন অ্যাসেট তৈরি করে এবং আপনার জন্য তৈরি লোকেশন সিঙ্ক অ্যাসেট সেটে যোগ করে, ঠিক যেমন আপনি AssetSetAssetService ব্যবহার করে ম্যানুয়ালি এটি করেন। যদি না আপনি স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেটে ম্যানুয়ালি যোগ করতে চান, তাহলে আপনাকে এগুলি ম্যানিপুলেট করার দরকার নেই।

একজন গ্রাহকের জন্য ( ENABLED এর status ) সহ শুধুমাত্র একটি সক্রিয় অবস্থান সিঙ্ক সম্পদ সেট বিদ্যমান থাকতে পারে। যদি আপনার অন্য ধরণের অবস্থান সিঙ্ক সম্পদ সেট তৈরি করার প্রয়োজন হয়, তাহলে প্রথমে বিদ্যমানটি সরিয়ে ফেলুন।

গ্রাহকের সাথে লোকেশন সিঙ্ক অ্যাসেট সেট সংযুক্ত করুন

পূর্ববর্তী বিভাগে লোকেশন সিঙ্ক অ্যাসেট সেটটি আপনার গ্রাহকের সাথে সংযুক্ত করতে CustomerAssetSetService.MutateCustomerAssetSets ব্যবহার করুন।

(ঐচ্ছিক) একটি লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করুন এবং এটি একটি ক্যাম্পেইন বা বিজ্ঞাপন গ্রুপের সাথে সংযুক্ত করুন

লোকেশন অ্যাসেটের একটি উপসেট নির্বাচন করার প্রয়োজন হলেই কেবল লোকেশন গ্রুপ অ্যাসেট সেট প্রয়োজন। এটি প্রচারাভিযান এবং বিজ্ঞাপন গ্রুপগুলি গ্রাহক স্তর থেকে লোকেশন অ্যাসেট উত্তরাধিকারসূত্রে পাওয়ার কারণে।

লোকেশন গ্রুপ অ্যাসেট সেটগুলিতে লোকেশন সিঙ্ক অ্যাসেট সেটের লোকেশন অ্যাসেটের একটি সাবসেট থাকে। আপনি Google Business Profile এর কিছু বৈশিষ্ট্য (যেমন লেবেল দ্বারা ফিল্টার করা) অথবা চেইন আইডি এবং চেইন লোকেশন ব্যবহার করে গতিশীলভাবে একটি লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করতে পারেন। বিকল্পভাবে, আপনি স্ট্যাটিকভাবে একটি লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করতে পারেন।

  1. একটি লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করুন । লোকেশন গ্রুপ অ্যাসেট সেটটি ডায়নামিক বা স্ট্যাটিক হতে পারে।
  2. আপনার প্রয়োজনের উপর নির্ভর করে, একটি বিজ্ঞাপন গোষ্ঠী ব্যবহার করে একটি প্রচারণায় বা একটি বিজ্ঞাপন গোষ্ঠীর সাথে সম্পদ সেট সংযুক্ত করুন
  3. (ঐচ্ছিক) নতুন তৈরি স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেটে পূর্বে তৈরি সম্পদগুলি যোগ করুন

একটি নির্দিষ্ট গ্রাহকের জন্য, আপনি একাধিক গতিশীল বা স্ট্যাটিক অবস্থান গ্রুপ সম্পদ সেট তৈরি করতে পারেন।

একটি লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করুন

একটি নতুন AssetSet তৈরি করুন এবং পূর্বে তৈরি করা লোকেশন সিঙ্ক অ্যাসেট সেটের আইডিতে location_group_parent_asset_set_id সেট করুন।

তারপর, আপনি একটি গতিশীল বা স্ট্যাটিক অবস্থান গ্রুপ সম্পদ সেট তৈরি করতে চান কিনা তার উপর ভিত্তি করে কিছু ক্ষেত্র সেট করুন।

গতিশীল সম্পদ সেট

LocationSet এ আপনি যে ফিল্ডটি সেট করেছেন তার উপর নির্ভর করে, নিম্নলিখিত নিয়মের ভিত্তিতে ফিল্ডগুলি সেট করুন:

যদি আপনি নিম্নলিখিত ক্ষেত্রটি সেট করেন তারপর টাইপ সেট করুন এবং এই ক্ষেত্রটিকে asset_set_source oneof ক্ষেত্র হিসেবে সেট করুন।
business_profile_location_set BUSINESS_PROFILE_DYNAMIC_LOCATION_GROUP business_profile_location_group
chain_location_set CHAIN_DYNAMIC_LOCATION_GROUP chain_location_group

যদি আপনি লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করার সময় maps_location_set সেট করেন, তাহলে আপনি একটি ডায়নামিক লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করতে পারবেন না। এর কারণ হল আপনি প্লেস আইডি অনুসারে ম্যানুয়ালি লোকেশন যোগ করেছেন এবং এই ধরণের লোকেশনের জন্য আপনি কোনও ফিল্টারিং বৈশিষ্ট্য ব্যবহার করতে পারবেন না।

স্ট্যাটিক অ্যাসেট সেট

type STATIC_LOCATION_GROUP তে সেট করুন। আপনি LocationSet তে যেকোনো ধরণের লোকেশন সিঙ্ক অ্যাসেট সেটের জন্য স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করতে পারেন, আপনি যে কোনও ক্ষেত্র ( business_profile_location_set , chain_location_set , অথবা maps_location_set ) সেট করুন না কেন।

স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেটের জন্য, আপনাকে জেনারেট করা লোকেশন অ্যাসেটগুলিকে লোকেশন গ্রুপ অ্যাসেট সেটে ম্যানুয়ালি যোগ করতে হবে।

একটি প্রচারণা বা একটি বিজ্ঞাপন গোষ্ঠীতে সম্পদ সেট সংযুক্ত করুন

আপনার ক্যাম্পেইনে লোকেশন গ্রুপ অ্যাসেট সেট সংযুক্ত করতে CampaignAssetSetService.MutateCampaignAssetSets ব্যবহার করুন।

বিকল্পভাবে, যদি আপনি লোকেশন গ্রুপ অ্যাসেট সেটটি একটি বিজ্ঞাপন গ্রুপের সাথে সংযুক্ত করতে চান, তাহলে AdGroupAssetSetService.MutateAdGroupAssetSets ব্যবহার করুন।

(ঐচ্ছিক) স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেটে লোকেশন অ্যাসেট যোগ করুন

এই ধাপটি শুধুমাত্র তখনই প্রয়োজন যদি আপনি পূর্বে সেট করা একটি স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট তৈরি করেন।

  1. পূর্বে তৈরি করা লোকেশন সিঙ্ক অ্যাসেট সেটের জন্য স্বয়ংক্রিয়ভাবে তৈরি হওয়া অ্যাসেটের রিসোর্স নামগুলি আনতে asset_set_asset রিপোর্ট ব্যবহার করুন। শুধুমাত্র আপনার পছন্দের অ্যাসেটগুলি পুনরুদ্ধার করতে ফিল্টারিং ব্যবহার করুন।
  2. AssetSetAssetService.MutateAssetSetAssets ব্যবহার করে স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেটে এগুলি যোগ করুন।

ব্যবসার প্রোফাইলের লোকেশন আইডি ম্যানেজ করুন

যখন আপনি একটি business_profile_location_set ব্যবহার করেন এবং listing_id_filters এ ফিল্টার করেন যা Business Profile ওয়েবসাইট বা API থেকে পুনরুদ্ধার করা হয়, তখন এই সংখ্যাসূচক মানগুলিকে uint64 টাইপ থেকে int64 তে রূপান্তর করার প্রয়োজন হতে পারে। যদি আপনার কোডটি একটি রানটাইম ত্রুটি তৈরি করে যে listing_id_filters[] পুনরাবৃত্তি ক্ষেত্রে এটি যোগ করার সময় আপনার Business Profile location ID সীমার বাইরে, তাহলে আপনাকে সম্ভবত নিম্নলিখিত উদাহরণগুলির যেকোনো একটি ব্যবহার করে এটি রূপান্তর করতে হবে:

জাভা

/**
* Converts the business profile location ID to the format expected by the
* DynamicBusinessProfileLocationGroupFilter.listing_id_filters[] repeated field.
* The business profile location ID is an unsigned 64-bit integer, while the
* listing_id_filters[] field expects signed 64-bit integers. This means that
* for business profile location IDs that are out of range, we must perform the
* two's complement to convert it into a signed int.
 *
 * @param businessProfileLocationId The ID of a Business Profile location ID.
 * @return a Business Profile location ID as a signed 64-bit integer (long).
 */
public static long convertBusinessProfileLocationId(String businessProfileLocationId) {
    return Long.parseUnsignedLong(businessProfileLocationId);
}

সি#

/// <summary>
/// Converts the business profile location ID to the format expected by the
/// DynamicBusinessProfileLocationGroupFilter.listing_id_filters[] repeated field.
/// The business profile location ID is an unsigned 64-bit integer, while the
/// listing_id_filters[] field expects signed 64-bit integers. This means that
/// for business profile location IDs that are out of range, we must perform the
/// two's complement to convert it into a signed int.
/// </summary>
/// <param name="businessProfileLocationId">The ID of a Business Profile location.</param>
/// <returns>The converted business location ID in signed 64 bit.</returns>
public long ConvertBusinessProfileLocationId(ulong businessProfileLocationId)
{
  return unchecked((long)businessProfileLocationId);
}

পিএইচপি

/**
* Converts a business profile location ID to a signed 64 bit integer.
*
* Converts the business profile location ID to the format expected by the
* DynamicBusinessProfileLocationGroupFilter.listing_id_filters[] repeated field.
* The business profile location ID is an unsigned 64-bit integer, while the
* listing_id_filters[] field expects signed 64-bit integers. This means that
* for business profile location IDs that are out of range, we must perform the
* two's complement to convert it into a signed int.
*
* @param string $businessProfileLocationId the ID of a Business Profile location
* @return int the converted business location ID in signed 64 bit
*/
public static function convertBusinessProfileLocationId(string $businessProfileLocationId): int
{
    $unsignedMax = '18446744073709551615'; // 2^64 - 1
    $signedMax = '9223372036854775807'; // 2^63 - 1

    // Check if the business profile location ID is within 64 bit range.
    // If not, throw an error.
    if (bccomp($businessProfileLocationId, '0') < 0 || bccomp($businessProfileLocationId, $unsignedMax) > 0) {
        throw new InvalidArgumentException(
            'The given business profile location id is outside of the range for a 64 bit integer.'
        );
    }

    // Check if the business profile location ID is in signed 64 bit range.
    // If it's not, convert it to its two's complement.
    if (bccomp($businessProfileLocationId, $signedMax) > 0) {
        // Two's complement: ID - 2^64
        return (int) bcsub($businessProfileLocationId, '18446744073709551616');
    }

    return (int) $businessProfileLocationId;
}

পাইথন

import ctypes

def convert_business_profile_location_id(business_profile_location_id):
    """Converts a business profile location ID to a signed 64 bit integer.

    Converts the business profile location ID to the format expected by the
    DynamicBusinessProfileLocationGroupFilter.listing_id_filters[] repeated field.
    The business profile location ID is an unsigned 64-bit integer, while the
    listing_id_filters[] field expects signed 64-bit integers. This means that
    for business profile location IDs that are out of range, we must perform the
    two's complement to convert it into a signed int.

    Args:
        business_profile_location_id: the ID of a Business Profile location ID.

    Returns:
        a Business Profile location ID as a signed 64 bit integer.
    """
    # Check if the business profile location ID is within 64 bit range.
    # If not, throw an error.
    if business_profile_location_id >= 2 ** 64:
        raise ValueError(
            "The given business profile location id is outside of the range for a 64 bit integer."
        )
    # Check if the business profile location ID is in signed 64 bit range.
    # If it's not, convert it to its two's complement.
    elif business_profile_location_id >= 2 ** 63:
        return ctypes.c_int64(business_profile_location_id).value
    else:
        return business_profile_location_id

রুবি

# Converts the business profile location ID to the format expected by the
# DynamicBusinessProfileLocationGroupFilter.listing_id_filters[] repeated field.
# The business profile location ID is an unsigned 64-bit integer, while the
# listing_id_filters[] field expects signed 64-bit integers. This means that
# for business profile location IDs that are out of range, we must perform the
# two's complement to convert it into a signed int.
# Since Ruby supports arbitrary precision numbers, we have to calculate it
# manually.
LONG_MAX = 2 ** 63
ULONG_MAX = LONG_MAX * 2
def convert_business_profile_location_id(business_profile_location_id)
  # Check if the business profile location ID is within 64 bit range.
  # If not, throw an error.
  if business_profile_location_id >= 2 ** 64
    raise "The given business profile location id is outside of the range for a 64 bit integer."
  # Check if the business profile location ID is in signed 64 bit range.
  # If it's not, convert it to its two's complement.
  elseif business_profile_location_id >= 2**63
    -1 * (ULONG_MAX - business_profile_location_id)
  else
    business_profile_location_id
  end
end

পার্ল

use bigint;

# Converts the business profile location ID to the format expected by the
# DynamicBusinessProfileLocationGroupFilter.listing_id_filters[] repeated field.
# The business profile location ID is an unsigned 64-bit integer, while the
# listing_id_filters[] field expects signed 64-bit integers. This means that
# for business profile location IDs that are out of range, we must perform the
# two's complement to convert it into a signed int.
sub convert_business_profile_location_id {
  my ($business_profile_location_id) = @_;

  # Check if the business profile location ID is within 64 bit range.
  # If not, throw an error.
  if ($business_profile_location_id >= 2**64) {
    die "The given business profile location id is outside of the range for a 64 bit integer";
  # Check if the business profile location ID is in signed 64 bit range.
  # If it's not, convert it to its two's complement.
  } elseif ($business_profile_location_id >= 2**63) {
    return -1 * (2**64 - $business_profile_location_id);
  } else {
    return $business_profile_location_id;
  }
}