UserWarning:字段值可能不兼容。期望列表
FIELDS = [
(adsinsights.AdsInsights.Field.ad_id),
(adsinsights.AdsInsights.Field.adset_name),
(adsinsights.AdsInsights.Field.campaign_id),
(adsinsights.AdsInsights.Field.reach),
(adsinsights.AdsInsights.Field.frequency),
(adsinsights.AdsInsights.Field.impressions),
(adsinsights.AdsInsights.Field.spend),
(adsinsights.AdsInsights.Field.inline_link_clicks),
(adsinsights.AdsInsights.Field.unique_clicks),
(adsinsights.AdsInsights.Field.cost_per_inline_link_click),
(adsinsights.AdsInsights.Field.cost_per_inline_post_engagement),
(adsinsights.AdsInsights.Field.cost_per_unique_click)
]
def readInsightsFromCampaign(campaignId):
FacebookAdsApi.init(access_token=ACCESS_TOKEN, api_version=API_VERSION)
c = campaign.Campaign(campaignId)
params = {
'level': adsinsights.AdsInsights.Level.account,
'date_preset': campaign.Campaign.DatePreset.last_90d,
'fields': FIELDS
}
insights = c.get_insights(params=params)
return insights
此警告是什么意思?而我该如何避免呢?非常感谢,添