অন্যান্য অ্যাসেটের মতো নয়, আপনি একটি অ্যাসেট সেট তৈরি করার পর গুগল অ্যাডস এপিআই দ্বারা লোকেশন অ্যাসেটগুলো স্বয়ংক্রিয়ভাবে তৈরি হয়ে যায়। প্রথমে, একটি লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করুন এবং এটিকে কাস্টমারের সাথে সংযুক্ত করুন। এরপর, যদি কোনো ক্যাম্পেইন বা অ্যাড গ্রুপের জন্য অ্যাসেট সেটের লোকেশন অ্যাসেটগুলোর একটি উপসেট নির্বাচন করার প্রয়োজন হয়, তাহলে একটি লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করুন এবং এটিকে সেই ক্যাম্পেইন বা অ্যাড গ্রুপের সাথে সংযুক্ত করুন।
একটি লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করুন এবং এটিকে গ্রাহকের সাথে সংযুক্ত করুন।
- একটি অবস্থান সিঙ্ক অ্যাসেট সেট তৈরি করুন ।
-
CustomerAssetSetServiceব্যবহার করে এটিকে একজন গ্রাহকের সাথে সংযুক্ত করুন ।
একটি অবস্থান সিঙ্ক অ্যাসেট সেট তৈরি করুন
- একটি নতুন
AssetSetতৈরি করুন।-
typeLOCATION_SYNCএ সেট করুন। -
location_setএকটি নতুনLocationSetএ সেট করুন।
-
নতুন
LocationSetএ,- আপনার ব্যবহারের ক্ষেত্র অনুযায়ী
location_ownership_typeসেট করুন:- আপনি যদি ব্যবসার স্থানটির মালিক হন, তবে এটিকে
BUSINESS_OWNERএ সেট করুন। - যদি ব্যবসার স্থানটি আপনার নিজের না হয়, কিন্তু আপনি সেখানে আপনার পণ্য বিক্রি করেন, তাহলে এটিকে
AFFILIATEহিসেবে সেট করুন।
- আপনি যদি ব্যবসার স্থানটির মালিক হন, তবে এটিকে
আপনার ব্যবহারের ক্ষেত্র অনুযায়ী
source'oneof' ফিল্ডটি সেট করুন:আপনার গুগল বিজনেস প্রোফাইল অ্যাকাউন্টের অবস্থানগুলোর সাথে সিঙ্ক করতে চাইলে
business_profile_location_setসেট করুন।যখন আপনি একটি Google Business Profile অ্যাকাউন্টের সাথে Google Ads লিঙ্ক করার জন্য একটি
BusinessProfileLocationSetতৈরি করেন, তখন আপনাকে অবশ্যইhttp_authorization_tokenফিল্ডে একটি OAuth 2.0 অ্যাক্সেস টোকেন প্রদান করতে হবে। এই টোকেনটি প্রমাণ হিসেবে কাজ করে যে, আপনি নির্দিষ্ট Google Business Profile থেকে লোকেশন ডেটা অ্যাক্সেস করার জন্য Google Ads-কে অনুমোদন দিচ্ছেন।টোকেনটিকে অবশ্যই এই শর্তগুলো পূরণ করতে হবে:
- এটি অবশ্যই সেই গুগল অ্যাকাউন্টের (ব্যবহারকারী বা পরিষেবা অ্যাকাউন্ট) জন্য তৈরি করতে হবে, যার ইমেল ঠিকানাটি
BusinessProfileLocationSetএরemail_addressফিল্ডে প্রদান করা হয়েছে। - গুগল বিজনেস প্রোফাইলের মধ্যে থাকা ব্যবসার অবস্থানগুলো পড়ার জন্য এই অ্যাকাউন্টের পর্যাপ্ত অনুমতি থাকতে হবে।
- OAuth 2.0 টোকেনটি অবশ্যই
https://www.googleapis.com/auth/business.manageস্কোপের মাধ্যমে সংগ্রহ করতে হবে।
OAuth 2.0 অ্যাক্সেস টোকেন কীভাবে তৈরি করতে হয় তার বিস্তারিত নির্দেশাবলীর জন্য, “Using OAuth 2.0 to Access Google APIs” দেখুন।
- এটি অবশ্যই সেই গুগল অ্যাকাউন্টের (ব্যবহারকারী বা পরিষেবা অ্যাকাউন্ট) জন্য তৈরি করতে হবে, যার ইমেল ঠিকানাটি
নির্দিষ্ট চেইন আইডি-র লোকেশনগুলোর সাথে সিঙ্ক করতে চাইলে
chain_location_setসেট করুন।প্লেস আইডি ব্যবহার করে ম্যানুয়ালি লোকেশন যোগ করতে চাইলে
maps_location_setসেট করুন।
- আপনার ব্যবহারের ক্ষেত্র অনুযায়ী
এই ধাপগুলো সম্পন্ন করার পর, Google Ads API আপনার জন্য লোকেশন অ্যাসেট তৈরি করে এবং সেগুলোকে তৈরি করা লোকেশন সিঙ্ক অ্যাসেট সেটে যুক্ত করে দেয়, ঠিক যেমন আপনি AssetSetAssetService ব্যবহার করে ম্যানুয়ালি করে থাকেন। আপনার এগুলো পরিবর্তন করার প্রয়োজন নেই, যদি না আপনি এগুলোকে ম্যানুয়ালি কোনো স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেটে যুক্ত করতে চান।
একজন গ্রাহকের জন্য শুধুমাত্র একটি সক্রিয় লোকেশন সিঙ্ক অ্যাসেট সেট (যার status ENABLED ) থাকতে পারে। যদি আপনাকে ভিন্ন ধরনের লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করতে হয়, তাহলে প্রথমে বিদ্যমানটি মুছে ফেলুন।
অবস্থান সিঙ্ক অ্যাসেট সেটটি একজন গ্রাহকের সাথে সংযুক্ত করুন।
পূর্ববর্তী বিভাগে উল্লিখিত লোকেশন সিঙ্ক অ্যাসেট সেটটি আপনার গ্রাহকের সাথে সংযুক্ত করতে CustomerAssetSetService.MutateCustomerAssetSets ব্যবহার করুন।
(ঐচ্ছিক) একটি লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করুন এবং এটিকে একটি ক্যাম্পেইন বা অ্যাড গ্রুপের সাথে সংযুক্ত করুন।
লোকেশন অ্যাসেটের একটি উপসেট নির্বাচন করার প্রয়োজন হলেই কেবল একটি লোকেশন গ্রুপ অ্যাসেট সেট দরকার হয়। এর কারণ হলো, ক্যাম্পেইন এবং অ্যাড গ্রুপগুলো কাস্টমার লেভেল থেকে লোকেশন অ্যাসেট উত্তরাধিকারসূত্রে পায়।
লোকেশন গ্রুপ অ্যাসেট সেটে লোকেশন সিঙ্ক অ্যাসেট সেটের লোকেশন অ্যাসেটগুলোর একটি উপসেট থাকে। আপনি গুগল বিজনেস প্রোফাইলের কিছু ফিচার (যেমন লেবেল দ্বারা ফিল্টারিং) অথবা চেইন আইডি এবং চেইন লোকেশন ব্যবহার করে ডাইনামিকভাবে একটি লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করতে পারেন। বিকল্পভাবে, আপনি স্ট্যাটিক্যালি একটি লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করতে পারেন।
- একটি অবস্থান গ্রুপ অ্যাসেট সেট তৈরি করুন । অবস্থান গ্রুপ অ্যাসেট সেটটি ডাইনামিক বা স্ট্যাটিক হতে পারে।
- আপনার প্রয়োজন অনুযায়ী অ্যাসেট সেটটিকে একটি ক্যাম্পেইনে অথবা একটি অ্যাড গ্রুপে সংযুক্ত করুন ।
- (Optional) Add the previously generated assets to the newly created static location group asset set .
একজন নির্দিষ্ট গ্রাহকের জন্য আপনি একাধিক ডাইনামিক বা স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করতে পারেন।
একটি অবস্থান গ্রুপ অ্যাসেট সেট তৈরি করুন
একটি নতুন 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 ব্যবহার করুন।
(ঐচ্ছিক) অবস্থান সম্পদগুলিকে স্থির অবস্থান গ্রুপ সম্পদ সেটে যোগ করুন
এই ধাপটি শুধুমাত্র তখনই প্রয়োজন হবে, যদি আপনি পূর্বে একটি স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করে থাকেন।
- পূর্বে তৈরি করা লোকেশন সিঙ্ক অ্যাসেট সেটের জন্য স্বয়ংক্রিয়ভাবে তৈরি হওয়া অ্যাসেটগুলোর রিসোর্স নাম পেতে
asset_set_assetরিপোর্টটি ব্যবহার করুন। শুধুমাত্র আপনার পছন্দের অ্যাসেটগুলো পেতে ফিল্টারিং ব্যবহার করুন। -
AssetSetAssetService.MutateAssetSetAssetsব্যবহার করে সেগুলোকে স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেটে যুক্ত করুন।
ব্যবসায়িক প্রোফাইলের অবস্থান আইডিগুলি পরিচালনা করুন
যখন আপনি একটি business_profile_location_set ব্যবহার করেন এবং বিজনেস প্রোফাইল ওয়েবসাইট বা এপিআই থেকে প্রাপ্ত listing_id_filters উপর ফিল্টার করেন, তখন এই সাংখ্যিক মানগুলিকে uint64 টাইপ থেকে int64 টাইপে রূপান্তর করার প্রয়োজন হতে পারে। যদি listing_id_filters[] রিপিটেড ফিল্ডে আপনার বিজনেস প্রোফাইল লোকেশন আইডি যোগ করার সময় আপনার কোড একটি রানটাইম এরর তৈরি করে যে এটি সীমার বাইরে, তাহলে সম্ভবত আপনাকে নিম্নলিখিত উদাহরণগুলির যেকোনো একটি ব্যবহার করে এটি রূপান্তর করতে হবে:
জাভা
/**
* 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;
}
}