首页 文章

Facebook sdk marketing api通过date_preset获得批量见解

提问于
浏览
3

我正在尝试获取批量广告系列,广告和广告的见解,但我只能获取默认date_preset值的数据,这是我猜7天或其他什么 . 当我使用沙盒帐户时,我获得数据值,但在使用原始帐户后,我没有收到任何数据,因为缺少date_preset参数 . 这是我的要求,我无法弄清楚如何在其中添加date_preset param .

me?fields=adaccounts{campaigns{status,spend_cap,account_id,can_use_spend_cap,start_time,stop_time,name,id,adsets{id,name,bid_amount,billing_event,daily_budget,end_time,lifetime_budget,optimization_goal,promoted_object,start_time,targetingsentencelines{params,id,targetingsentencelines},insights,ads{insights{frequency,impressions,reach,social_reach,social_spend,social_impressions,spend,cpm,cost_per_total_action,ad_id},id,name}},insights{frequency,impressions,reach,social_clicks,social_reach,social_impressions,social_spend,spend,cpm,cost_per_total_action}},activities},id

您可以在图形api资源管理器中使用它,如果您使用沙盒帐户,它将返回正确的见解 . 我正在使用

api版本2.12

1 回答

  • 0

    以下是我们如何使用date_preset参数如果指定了time_range或time_ranges,则忽略此字段 .

    ?<AD_ID>/insights?fields=impressions,clicks,ctr,campaign_name&date_preset=last_30d
    

    在上面的URL中,您也可以使用 < ACCOUNT_ID > , < CAMPAIGN_ID > or < ADSET_ID > 来查询这些对象,date_preset参数也可以正常工作 .

    date_preset 的允许值为

    enum {today,昨天,this_month,last_month,this_quarter,lifetime,last_3d,last_7d,last_14d,last_28d,last_30d,last_90d,last_week_mon_sun,last_week_sun_sat,last_quarter,last_year,this_week_mon_today,this_week_sun_today,this_year}

    Link To The FB Docs Page

相关问题