다른 확장 소재와 달리 위치 확장 소재는 확장 소재 세트를 만든 후 Google Ads API에 의해 자동으로 생성됩니다. 먼저 위치 동기화 확장 소재 세트를 만들고 고객에게 연결합니다. 그런 다음 캠페인 또는 광고 그룹의 확장 소재 세트에서 위치 확장 소재의 하위 집합을 선택해야 하는 경우 위치 그룹 확장 소재 세트를 만들어 캠페인 또는 광고 그룹에 연결합니다.
위치 동기화 확장 소재 세트를 만들어 고객에게 연결
위치 동기화 확장 소재 세트 만들기
- 새
AssetSet
를 만듭니다.type
을LOCATION_SYNC
로 설정합니다.location_set
을 새LocationSet
로 설정합니다.
- 새
LocationSet
에서- 사용 사례에 따라
location_ownership_type
를 설정합니다.- 비즈니스 위치를 소유한 경우
BUSINESS_OWNER
로 설정합니다. - 비즈니스 위치를 소유하지는 않지만 해당 위치에서 제품을 판매하는 경우
AFFILIATE
로 설정합니다.
- 비즈니스 위치를 소유한 경우
- 사용 사례에 따라
source
oneof 필드를 설정합니다.- Google 비즈니스 프로필 계정의 위치와 동기화하려면
business_profile_location_set
를 설정합니다. - 지정된 체인 ID의 위치와 동기화하려면
chain_location_set
를 설정합니다. - 장소 ID를 사용하여 위치를 수동으로 추가하려면
maps_location_set
를 설정합니다.
- Google 비즈니스 프로필 계정의 위치와 동기화하려면
- 사용 사례에 따라
이 단계를 완료하면 Google Ads API는 위치 애셋을 생성하고 AssetSetAssetService
를 사용하여 수동으로 수행하는 것과 마찬가지로 생성된 위치 동기화 애셋 세트에 추가합니다. 정적 위치 그룹 애셋 세트에 수동으로 추가하려는 경우가 아니라면 조작할 필요가 없습니다.
고객에게는 status
(ENABLED
)이 있는 활성 위치 동기화 애셋 세트가 하나만 있을 수 있습니다. 다른 유형의 위치 동기화 애셋 세트를 만들어야 하는 경우 먼저 기존 애셋 세트를 삭제하세요.
위치 동기화 애셋 세트를 고객에게 연결
CustomerAssetSetService.MutateCustomerAssetSets
를 사용하여 이전 섹션에서 설정한 위치 동기화 확장 소재 세트를 고객에게 연결합니다.
(선택사항) 위치 그룹 확장 소재 세트를 만들어 캠페인 또는 광고 그룹에 연결
위치 그룹 확장 소재 세트는 위치 확장 소재의 하위 집합을 선택해야 하는 경우에만 필요합니다. 캠페인 및 광고 그룹이 고객 수준에서 위치 확장 소재를 상속하기 때문입니다.
위치 그룹 애셋 세트에는 위치 동기화 애셋 세트의 위치 애셋 하위 집합이 포함됩니다. Google 비즈니스 프로필의 일부 기능 (예: 라벨별 필터링) 또는 체인 ID 및 체인 위치를 활용하여 위치 그룹 확장 소재 세트를 동적으로 만들 수 있습니다. 또는 위치 그룹 애셋 세트를 정적으로 만들 수 있습니다.
- 위치 그룹 애셋 세트 만들기 위치 그룹 확장 소재 세트는 동적 또는 정적일 수 있습니다.
- 필요에 따라 확장 소재 세트를 캠페인 또는 광고 그룹에 연결합니다.
- (선택사항) 이전에 생성된 애셋을 새로 만든 정적 위치 그룹 애셋 세트에 추가합니다.
특정 고객의 경우 여러 동적 또는 정적 위치 그룹 애셋 세트를 만들 수 있습니다.
위치 그룹 애셋 세트 만들기
새 AssetSet
를 만들고 location_group_parent_asset_set_id
을 이전에 만든 위치 동기화 애셋 세트의 ID로 설정합니다.
그런 다음 동적 또는 정적 위치 그룹 확장 소재 세트를 만들지 여부에 따라 일부 필드를 설정합니다.
동적 애셋 세트
LocationSet
에서 설정한 필드에 따라 다음 규칙에 따라 필드를 설정합니다.
다음 필드를 설정하는 경우 | 그런 다음 type을 | 이 필드를 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
를 설정하면 동적 위치 그룹 애셋 세트를 만들 수 없습니다. 이는 장소 ID로 위치를 수동으로 추가했으며 이 유형의 위치에 사용할 수 있는 필터링 기능이 없기 때문입니다.
정적 애셋 세트
type
을 STATIC_LOCATION_GROUP
로 설정합니다.
LocationSet
에서 설정하는 필드 (business_profile_location_set
, chain_location_set
또는 maps_location_set
)와 관계없이 모든 유형의 위치 동기화 애셋 세트에 대해 정적 위치 그룹 애셋 세트를 만들 수 있습니다.
정적 위치 그룹 애셋 세트의 경우 생성된 위치 확장 소재를 위치 그룹 애셋 세트에 수동으로 추가해야 합니다.
애셋 세트를 캠페인 또는 광고 그룹에 연결
CampaignAssetSetService.MutateCampaignAssetSets
을 사용하여 위치 그룹 확장 소재 세트를 캠페인에 연결합니다.
또는 위치 그룹 확장 소재 세트를 광고 그룹에 연결하려면 AdGroupAssetSetService.MutateAdGroupAssetSets
을 사용하세요.
(선택사항) 정적 위치 그룹 애셋 세트에 위치 확장 소재 추가
이 단계는 이전에 정적 위치 그룹 애셋 세트를 만든 경우에만 필요합니다.
asset_set_asset
보고서를 사용하여 이전에 만든 위치 동기화 확장 소재 세트에 대해 자동으로 생성된 확장 소재의 리소스 이름을 가져옵니다. 필터링을 사용하여 원하는 저작물만 검색합니다.AssetSetAssetService.MutateAssetSetAssets
를 사용하여 정적 위치 그룹 확장 소재 세트에 추가합니다.
비즈니스 프로필 위치 ID 관리
business_profile_location_set
를 사용하고 비즈니스 프로필 웹사이트 또는 API에서 가져온 listing_id_filters
를 필터링할 때는 이러한 숫자 값을 uint64
유형에서 int64
로 변환해야 할 수 있습니다. listing_id_filters[] 반복 필드에 추가할 때 코드가 비즈니스 프로필 위치 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);
}
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 >= 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 >= 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
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 >= 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;
}
}