অন্যান্য অ্যাসেটের মতো, আপনি অ্যাসেট সেট তৈরি করার পরে Google Ads API অটোমেটিক লোকেশন অ্যাসেট তৈরি করে। প্রথমে, লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করুন এবং এটি গ্রাহকের সাথে অ্যাটাচ করুন। তারপর, কোনও ক্যাম্পেন বা বিজ্ঞাপন গ্রুপের জন্য অ্যাসেট সেটে লোকেশন অ্যাসেটের সাবসেট বেছে নিতে হলে, লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করে ক্যাম্পেন বা বিজ্ঞাপন গ্রুপের সাথে অ্যাটাচ করুন।
লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করে গ্রাহকের সাথে অ্যাটাচ করুন
- লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করুন।
CustomerAssetSetServiceব্যবহার করে এটি কোনও গ্রাহকের সাথে অ্যাটাচ করুন।
লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করুন
- নতুন
AssetSetতৈরি করুন।type-কেLOCATION_SYNC-এ সেট করুন।location_set-কে নতুনLocationSet-এ সেট করুন।
নতুন
LocationSet-এ,- আপনার ব্যবহারের উপর ভিত্তি করে
location_ownership_typeসেট করুন:- আপনি ব্যবসার লোকেশনের মালিক হলে
এটি
BUSINESS_OWNERহিসেবে সেট করুন। - আপনি যদি ব্যবসার লোকেশনের মালিক না হন, কিন্তু সেখানে আপনার প্রোডাক্ট বিক্রি করেন,
তাহলে এটি
AFFILIATEহিসেবে সেট করুন।
- আপনি ব্যবসার লোকেশনের মালিক হলে
এটি
আপনার ব্যবহারের উপর ভিত্তি করে
sourceoneof ফিল্ড সেট করুন:আপনার Google Business Profile অ্যাকাউন্টে আপনার লোকেশনের সাথে সিঙ্ক করতে চাইলে,
business_profile_location_setসেট করুন।Google Business Profile অ্যাকাউন্টের সাথে Google Ads লিঙ্ক করার জন্য
BusinessProfileLocationSetতৈরি করার সময়, আপনাকেhttp_authorization_tokenফিল্ডে OAuth 2.0 অ্যাক্সেস টোকেন দিতে হবে। এই টোকেন প্রমাণ করে যে আপনি Google Ads-কে নির্দিষ্ট Google Business Profile থেকে লোকেশন ডেটা অ্যাক্সেস করার অনুমতি দিচ্ছেন।টোকেনকে এইসব প্রয়োজনীয়তা পূরণ করতে হবে:
- এটি সেই 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 ব্যবহার করা লিঙ্ক দেখুন।
- এটি সেই Google অ্যাকাউন্টের (ব্যবহারকারী বা পরিষেবা অ্যাকাউন্ট) জন্য তৈরি করতে হবে যার ইমেল আইডি
নির্দিষ্ট চেন আইডিতে লোকেশনের সাথে সিঙ্ক করতে চাইলে,
chain_location_setসেট করুন।প্লেস আইডি ব্যবহার করে ম্যানুয়ালি লোকেশন যোগ করতে চাইলে,
maps_location_setসেট করুন।
- আপনার ব্যবহারের উপর ভিত্তি করে
আপনি এইসব ধাপ সম্পূর্ণ করার পরে, Google Ads API লোকেশন
অ্যাসেট তৈরি করে এবং আপনার জন্য তৈরি করা লোকেশন সিঙ্ক অ্যাসেট সেটে সেগুলি যোগ করে, ঠিক যেমন
আপনি AssetSetAssetService ব্যবহার করে
ম্যানুয়ালি করেন। আপনি ম্যানুয়ালি স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেটে এগুলি যোগ করতে না চাইলে,
এগুলি ম্যানিপুলেট করার প্রয়োজন নেই।
কোনও গ্রাহকের জন্য
ENABLED-এ সেট করা
status সহ
শুধুমাত্র একটি অ্যাক্টিভ লোকেশন সিঙ্ক অ্যাসেট সেট
থাকতে পারে। আপনাকে অন্য ধরনের লোকেশন সিঙ্ক অ্যাসেট সেট তৈরি করতে হলে, প্রথমে আগে থেকে থাকা সেটটি সরিয়ে দিন।
গ্রাহকের সাথে লোকেশন সিঙ্ক অ্যাসেট সেট অ্যাটাচ করুন
আগের বিভাগে সেট করা লোকেশন সিঙ্ক অ্যাসেট আপনার গ্রাহকের সাথে অ্যাটাচ করতে
CustomerAssetSetService.MutateCustomerAssetSets
ব্যবহার করুন।
(ঐচ্ছিক) লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করুন এবং এটি কোনও ক্যাম্পেন বা বিজ্ঞাপন গ্রুপের সাথে অ্যাটাচ করুন
আপনি লোকেশন অ্যাসেটের সাবসেট বেছে নিতে চাইলে তবেই লোকেশন গ্রুপ অ্যাসেট সেট প্রয়োজন হয়। ক্যাম্পেন ও বিজ্ঞাপন গ্রুপ গ্রাহক লেভেল থেকে লোকেশন অ্যাসেট ইনহেরিট করার কারণে এটি হয়।
লোকেশন গ্রুপ অ্যাসেট সেটে লোকেশন সিঙ্ক অ্যাসেট সেটের লোকেশন অ্যাসেটের সাবসেট থাকে। আপনি Google Business Profile-এর কিছু ফিচার (যেমন, লেবেল অনুযায়ী ফিল্টার করা) বা চেন আইডি ও চেন লোকেশন ব্যবহার করে ডায়নামিকভাবে লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করতে পারবেন। অন্যথায়, আপনি স্ট্যাটিক্যালি লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করতে পারবেন।
- লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করুন। লোকেশন গ্রুপ অ্যাসেট সেট ডায়নামিক বা স্ট্যাটিক হতে পারে।
- আপনার প্রয়োজন অনুযায়ী, কোনও ক্যাম্পেন বা বিজ্ঞাপন গ্রুপের সাথে অ্যাসেট সেট অ্যাটাচ করুন।
- (ঐচ্ছিক) আগে থেকে তৈরি করা অ্যাসেট নতুন তৈরি করা স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেটে যোগ করুন।
কোনও নির্দিষ্ট গ্রাহকের জন্য, আপনি একাধিক ডায়নামিক বা স্ট্যাটিক লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করতে পারবেন।
লোকেশন গ্রুপ অ্যাসেট সেট তৈরি করুন
নতুন 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-এর লোকেশন আইডি ম্যানেজ করা
আপনি যখন Business Profile ওয়েবসাইট বা API থেকে পাওয়া
listing_id_filters-এর উপর business_profile_location_set এবং ফিল্টার ব্যবহার করেন, তখন এইসব সংখ্যাসূচক ভ্যালু
uint64 থেকে int64-এ কনভার্ট করার প্রয়োজন হতে পারে। আপনার কোড যদি রানটাইম সমস্যা তৈরি করে যে আপনার
Business Profile লোকেশন আইডি রেঞ্জের বাইরে যখন এটি
listing_id_filters[] রিপিটেড ফিল্ডে যোগ করা হয়, তাহলে আপনাকে সম্ভবত নিম্নলিখিত যেকোনও উদাহরণ ব্যবহার করে
এটি কনভার্ট করতে হবে:
Java
/**
* 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);
}
C#
/// <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);
}
PHP
/**
* 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;
}
Python
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 < 0 or 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
Ruby
# 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 < 0 || 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.
elsif business_profile_location_id >= 2**63
-1 * (ULONG_MAX - business_profile_location_id)
else
business_profile_location_id
end
end
Perl
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 < 0 || $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.
} elsif ($business_profile_location_id >= 2**63) {
return -1 * (2**64 - $business_profile_location_id);
} else {
return $business_profile_location_id;
}
}