本文整理汇总了Python中facebookads.objects.AdSet.get_ad_groups方法的典型用法代码示例。如果您正苦于以下问题:Python AdSet.get_ad_groups方法的具体用法?Python AdSet.get_ad_groups怎么用?Python AdSet.get_ad_groups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类facebookads.objects.AdSet
的用法示例。
在下文中一共展示了AdSet.get_ad_groups方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: copy
# 需要导入模块: from facebookads.objects import AdSet [as 别名]
# 或者: from facebookads.objects.AdSet import get_ad_groups [as 别名]
def copy(self):
store_url = config['link_url'][self.param['account']][self.param['os']]
link_url = store_url.replace('https://', 'http://')
campaign = AdCampaign(self.param['campaign_id'])
campaign.remote_read(
fields=[
AdCampaign.Field.name
]
)
adset = AdSet(self.param['adset_id'])
adset.remote_read(
fields=[
AdSet.Field.name,
AdSet.Field.daily_budget,
AdSet.Field.pacing_type,
AdSet.Field.promoted_object,
AdSet.Field.targeting,
AdSet.Field.is_autobid,
AdSet.Field.billing_event,
AdSet.Field.optimization_goal,
AdSet.Field.bid_amount,
AdSet.Field.rtb_flag
]
)
# pp.pprint(adset)
adgroups = adset.get_ad_groups(
fields=[
AdGroup.Field.name,
AdGroup.Field.creative,
AdGroup.Field.tracking_specs,
AdGroup.Field.status
],
params={
AdGroup.Field.status: ['ACTIVE']
}
)
# pp.pprint(adgroups)
object_store_url = adset['promoted_object']['object_store_url']
replace_url = object_store_url.replace('https://', 'http://')
if link_url != replace_url:
return self.different_os_copy(campaign, adset, adgroups)
else:
return self.same_os_copy(campaign, adset, adgroups)
示例2: print
# 需要导入模块: from facebookads.objects import AdSet [as 别名]
# 或者: from facebookads.objects.AdSet import get_ad_groups [as 别名]
AdSet.Field.end_time: end_date,
})
ad_set.remote_create()
print(ad_set)
# _DOC close [ADSET_CREATE_HOMEPAGE]
ad_set_id = fixtures.create_adset().get_id_assured()
# _DOC open [ADSET_GET_ADGROUPS]
# _DOC vars [ad_set_id]
from facebookads.objects import AdSet, AdGroup
ad_set = AdSet(ad_set_id)
ad_group_iter = ad_set.get_ad_groups(fields=[AdGroup.Field.name])
for ad_group in ad_group_iter:
print(ad_group[AdGroup.Field.name])
# _DOC close [ADSET_GET_ADGROUPS]
ad_set_id = fixtures.create_adset().get_id_assured()
# _DOC open [ADSET_READ_ADCREATIVE]
# _DOC vars [ad_set_id]
from facebookads.objects import AdSet, AdCreative
adset = AdSet(fbid=ad_set_id)
adset.get_ad_creatives([AdCreative.Field.object_story_id])
# _DOC close [ADSET_READ_ADCREATIVE]