할 일 등록정보 그룹 만들기

여행지 정보 광고 그룹의 등록정보 그룹을 만드는 과정은 호텔 광고 등록정보 그룹과 동일한 구조적 계층 구조 및 트리 빌드 프로세스를 따릅니다.

할 일 인벤토리를 분할하려면 ListingDimensionInfo에서 사용할 수 있는 특수 활동 측정기준을 사용하세요.

  • ActivityCountryInfo: 지역 타겟 상수 리소스 이름 (geoTargetConstants/{criterion_id}, 예: 미국의 경우 "geoTargetConstants/2840")을 사용하여 대상 국가(value)를 기준으로 필터링합니다.
  • ActivityStateInfo: 지역 타겟 상수 리소스 이름 (geoTargetConstants/{criterion_id})을 사용하여 도착 주 또는 지역(value)을 기준으로 필터링합니다.
  • ActivityCityInfo: 지역 타겟 상수 리소스 이름(geoTargetConstants/{criterion_id}, 예: 뉴욕시의 경우 "geoTargetConstants/1023191")을 사용하여 목적지 도시(value)를 기준으로 필터링합니다.
  • ActivityRatingInfo: 활동 별표 또는 사용자 평점 (value, 1에서 5까지의 정수, 5가 가장 높음)으로 필터링합니다.
  • ActivityIdInfo: 할 일 센터 피드 (value)에 정의된 특정 활동 ID로 필터링합니다.

측정기준 계층 구조 규칙

할 일 등록정보 그룹 트리를 만들 때는 다음 규칙을 따르세요.

  1. 루트 노드: 모든 등록정보 그룹 트리는 listing_group.type가 SUBDIVISION (또는 단일 포괄 노드를 원하는 경우 UNIT)이고 case_value가 설정되지 않은 단일 루트 AdGroupCriterion로 시작해야 합니다.
  2. 하위 부서 및 단위: 중간 분기는 type를 SUBDIVISION로 설정해야 하고 리프 노드는 type를 UNIT로 설정해야 합니다. 할 일 캠페인의 경우 입찰가가 캠페인의 MaximizeConversionValue 전략에 의해 자동으로 관리되므로 UNIT 노드에서 cpc_bid_micros를 설정하는 것은 선택사항입니다. 제공에서 리프 단위를 제외하려면 AdGroupCriterion에서 negative = true를 설정합니다.
  3. 대체 ('기타') 노드: 모든 하위 구분은 완전히 분할되어야 합니다. 하위 항목의 모든 직계 하위 요소는 동일한 ListingDimensionInfo 하위 유형을 사용해야 하며, 하나의 하위 요소는 나머지 모든 인벤토리를 캡처하기 위해 해당 하위 유형의 빈 인스턴스여야 합니다.

다음 트리는 국가, 도시, 활동 ID로 파티션을 나눈 유효한 계층 구조를 보여줍니다.

Root (SUBDIVISION)
 ├── ActivityCountryInfo: "geoTargetConstants/2840" (US, SUBDIVISION)
 │    ├── ActivityCityInfo: "geoTargetConstants/1023191" (New York, SUBDIVISION)
 │    │    ├── ActivityIdInfo: "activity_123" (UNIT, biddable)
 │    │    └── ActivityIdInfo: <empty> (UNIT, "Everything else in New York")
 │    └── ActivityCityInfo: <empty> (UNIT, "Everything else in US")
 └── ActivityCountryInfo: <empty> (UNIT, negative=true, excluded)

코드 예

다음 Python 예시에서는 임시 ID(-1)를 사용하여 루트 SUBDIVISION를 만들고 ActivityCountryInfo로 파티션을 나누어 미국 ("geoTargetConstants/2840")을 타겟팅하는 단위와 다른 모든 국가를 제외하는 대체 단위로 나눕니다.

ad_group_service = client.get_service("AdGroupService")
ad_group_criterion_service = client.get_service("AdGroupCriterionService")
ad_group_resource_name = ad_group_service.ad_group_path(
    customer_id, ad_group_id
)
operations = []

# 1. Create the root SUBDIVISION node with temporary criterion ID -1.
root_op = client.get_type("AdGroupCriterionOperation")
root = root_op.create
root.resource_name = ad_group_criterion_service.ad_group_criterion_path(
    customer_id, ad_group_id, -1
)
root.status = client.enums.AdGroupCriterionStatusEnum.ENABLED
root.listing_group.type_ = client.enums.ListingGroupTypeEnum.SUBDIVISION
operations.append(root_op)

# 2. Create a child UNIT node targeting activities in the US.
us_op = client.get_type("AdGroupCriterionOperation")
us_unit = us_op.create
us_unit.ad_group = ad_group_resource_name
us_unit.status = client.enums.AdGroupCriterionStatusEnum.ENABLED
us_unit.listing_group.type_ = client.enums.ListingGroupTypeEnum.UNIT
us_unit.listing_group.parent_ad_group_criterion = root.resource_name
us_unit.listing_group.case_value.activity_country.value = "geoTargetConstants/2840"
operations.append(us_op)

# 3. Create the required fallback ("Everything else") UNIT node.
other_op = client.get_type("AdGroupCriterionOperation")
other_unit = other_op.create
other_unit.ad_group = ad_group_resource_name
other_unit.negative = True
other_unit.listing_group.type_ = client.enums.ListingGroupTypeEnum.UNIT
other_unit.listing_group.parent_ad_group_criterion = root.resource_name
client.copy_from(
    other_unit.listing_group.case_value.activity_country,
    client.get_type("ActivityCountryInfo"),
)
operations.append(other_op)

response = ad_group_criterion_service.mutate_ad_group_criteria(
    customer_id=customer_id, operations=operations
)

다음 단계