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