การสร้างกลุ่มรายชื่อสําหรับกลุ่มโฆษณากิจกรรมน่าสนใจจะเป็นไปตามลําดับชั้นเชิงโครงสร้างและกระบวนการสร้างโครงสร้างแบบต้นไม้เดียวกันกับกลุ่มรายชื่อโฆษณาโรงแรม
หากต้องการแบ่งพาร์ติชันพื้นที่โฆษณากิจกรรมน่าสนใจ ให้ใช้มิติข้อมูลกิจกรรมเฉพาะที่มีใน ListingDimensionInfo ดังนี้
ActivityCountryInfo: กรองตามประเทศปลายทาง (value) โดยใช้ชื่อทรัพยากรค่าคงที่ของเป้าหมายทางภูมิศาสตร์ (geoTargetConstants/{criterion_id}เช่น"geoTargetConstants/2840"สำหรับสหรัฐอเมริกา)ActivityStateInfo: กรองตามรัฐหรือภูมิภาคปลายทาง (value) โดยใช้ชื่อทรัพยากรค่าคงที่ของเป้าหมายทางภูมิศาสตร์ (geoTargetConstants/{criterion_id})ActivityCityInfo: กรองตามเมืองปลายทาง (value) โดยใช้ชื่อทรัพยากรค่าคงที่ของเป้าหมายทางภูมิศาสตร์ (geoTargetConstants/{criterion_id}เช่น"geoTargetConstants/1023191"สำหรับนครนิวยอร์ก)ActivityRatingInfo: กรองตามดาวของกิจกรรมหรือการให้คะแนนของผู้ใช้ (value, จำนวนเต็มตั้งแต่1ถึง5โดยที่5คือดีที่สุด)ActivityIdInfo: กรองตามรหัสกิจกรรมที่เฉพาะเจาะจงซึ่งกำหนดไว้ในฟีด Things to do Center (value)
กฎลำดับชั้นของมิติข้อมูล
เมื่อสร้างแผนผังกลุ่มรายชื่อกิจกรรมน่าสนใจ ให้ทำตามกฎต่อไปนี้
- โหนดรูท: แผนผังกลุ่มรายชื่อทุกแผนผังต้องเริ่มต้นด้วยรูท
AdGroupCriterionรายการเดียวที่มีlisting_group.typeเป็นSUBDIVISION(หรือUNITหากต้องการโหนดแบบครอบคลุมทั้งหมดเพียงโหนดเดียว) และไม่ได้ตั้งค่าcase_valueไว้ - แผนกย่อยและหน่วย: สาขาระดับกลางต้องตั้งค่า
typeเป็นSUBDIVISIONส่วนโหนดปลายสุดต้องตั้งค่าtypeเป็นUNITการตั้งค่าcpc_bid_microsในโหนดUNITเป็นตัวเลือกที่ไม่บังคับสำหรับแคมเปญกิจกรรมน่าสนใจ เนื่องจากกลยุทธ์MaximizeConversionValueของแคมเปญจะจัดการการเสนอราคาโดยอัตโนมัติ หากต้องการยกเว้นหน่วยย่อยจากการแสดงโฆษณา ให้ตั้งค่าnegative = trueในAdGroupCriterion - โหนดสำรอง ("อื่นๆ ที่เหลือ"): ทุกหมวดย่อยต้องแบ่งพาร์ติชันอย่างสมบูรณ์ หมวดหมู่ย่อยระดับแรกทั้งหมดต้องใช้ประเภทย่อย
ListingDimensionInfoเดียวกัน และหมวดหมู่ย่อยรายการหนึ่งต้องเป็นอินสแตนซ์ว่างของประเภทย่อยนั้นเพื่อบันทึกสินค้าคงคลังที่เหลือทั้งหมด
แผนภูมิต่อไปนี้แสดงลำดับชั้นที่ถูกต้องซึ่งแบ่งพาร์ติชันตามประเทศ เมือง และรหัสกิจกรรม
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 ต่อไปนี้จะสร้าง SUBDIVISION ระดับรูทโดยใช้รหัสชั่วคราว (-1) และแบ่งพาร์ติชันตาม 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
)
ขั้นตอนถัดไป
- ค้นหาเมตริกประสิทธิภาพของกิจกรรมในการรายงานกิจกรรมน่าสนใจ