use*_*226 4 statistics post facebook facebook-insights
我试图通过各种Facebook API来确定以下是否可行:
提前致谢!
小智 6
您希望通过Graph API和Marketing API获得所需的一切.
1)是的,正如你所指出的那样,这是可能的.你可以在这里阅读更多
2)我建议你阅读上面链接的Marketing API文档,找出广告的完整结构.但简而言之,广告分为以下4个对象:
3)当帖子有基于它创建的广告时,没有为广告目的创建"重复"帖子.如果您只想在帖子上获得付费/提升信息,那么最好的方法就是使用Ads Insights API.
4)当您从洞察API中提取统计信息时,您会看到附加了"付费"的指标,例如"post_impressions_paid".这将返回付费展示次数(即来自广告),但不会向您提供有关哪些广告会产生这些展示的任何信息.Ad Insights API仅会返回由投放帖子的广告所造成的展示次数,赞,评论等,他们不会返回有机操作.
这是一个cURL命令的快速运行,它将创建一个促进帖子的活动,但在尝试之前我会完全阅读Marketing API文档,以便您了解发生了什么.
// First we need to get the Ad Account from a user
curl https://graph.facebook.com/{USER_ID}/adaccounts&access_token={TOKEN}
// Now we can create our Ad Campaign. Response: {"id": "CAMPAIGN_GROUP_ID"}
curl \
-F 'name=my campaign group' \
-F 'campaign_group_status=PAUSED' \
-F 'objective=POST_ENGAGEMENT' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adcampaign_groups
// Using the Campaign Group ID we can create an Ad Set. Response: {"id": "AD_SET_ID"}
curl \
-F "name=My Adset" \
-F "bid_type=CPC" \
-F "bid_info={'CLICKS': 500}" \
-F "campaign_status=ACTIVE" \
-F "daily_budget=2000" \
-F "campaign_group_id=<AD_CAMPAIGN_ID>" \
-F "targeting={'geo_locations':{'countries':['US','GB']}}" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adcampaigns"
// Before we create an Ad Group, it is recommended to create an Ad Creative.
// Response: {"id": "CREATIVE_ID"}
curl \
-F "name=sample creative" \
-F "object_story_id=<POST_ID>" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adcreatives"
// Now that we have the Creative ID we can use that to create the final piece
// of the puzzle, the Ad Group. Response: {"id": "AD_GROUP_ID"}
curl \
-F "name=my ad" \
-F "campaign_id=<AD_SET_ID>" \
-F "creative={'creative_id':<AD_CREATIVE_ID>}" \
-F "adgroup_status=PAUSED" \
-F "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adgroups"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
319 次 |
| 最近记录: |