如何从facebook Marketing api中检索广告活动中的这些指定字段?

时间:2017-09-15 20:15:39

标签: python facebook facebook-graph-api

到目前为止,我已经从facebook广告经理检索了除交付,结果,每个结果的费用,桌面应用安装和移动应用安装之外的所有内容,如下所示。

ads manager

api文档中没有明确的字段,也没有文件本身可以提供有关这些字段的信息。

这是我的代码,我可以使用此

检索所有其他字段
from facebookads.adobjects.adaccount import AdAccount
from facebookads.adobjects.campaign import Campaign
from facebookads.adobjects.adset import AdSet
from facebookads.adobjects.adsinsights import AdsInsights

fields = {
    Campaign.Field.name,
    Campaign.Field.objective,
    # Campaign.Field.
}
params = {
    'date_preset' : 'last_90d',
    Campaign.Field.effective_status: [
        'ACTIVE',
        'PAUSED',
    ],
}

sets_fields = {
    AdSet.Field.name,
    AdSet.Field.end_time,
}

insight_params = {
    'date_preset': 'last_90d',
}

insight_fields = {
    AdsInsights.Field.campaign_name,
    AdsInsights.Field.reach,
    AdsInsights.Field.spend,
    AdsInsights.Field.total_action_value,
}

account = AdAccount('XXXXXXXXXXXXXXXX')
campaigns = account.get_campaigns(fields=fields, params=params)
# print campaigns
adcampaign = Campaign('XXXXXXXXXXXXXXX')
adsets = adcampaign.get_ad_sets(fields=sets_fields)
# print adsets
adinsights = adcampaign.get_insights(params=insight_params, fields=insight_fields)
print adinsights

有没有办法使用facebook api检索其他字段?

0 个答案:

没有答案