请帮助我修复 curl 命令和 python 代码。我正在放置密钥,但无法获取CAMPAIGN_ID
. 我为我的 facebook 页面创建了一个广告,但找不到CAMPAIGN_ID
,我尝试使用 Ad id,但这也没有用。
curl -G \
-d "level=ad" \
-d "fields=impressions,ad_id" \
-d "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/<CAMPAIGN_ID>/insights"
我也使用了下面的 python 代码,但出现了一些错误。
from facebook_business.objects import AdCampaign
campaign = AdCampaign('<AD_CAMPAIGN_ID>')
params = {
'date_preset': AdCampaign.Preset.last_7_days,
}
insights = campaign.get_insights(params=params)
print insights
以下是错误:
traceback (most recent call last): File "fbAds2.py", line 1, in <module> from facebook_business.objects import AdCampaign ModuleNotFoundError: No module named 'facebook_business.objects'```