1

I am able to get Facebook Campaign Insights using the marketing API, but I can only get it for a said period of time. The code below gives data for last 30 days. How can I get a dropdown to get data for user input period (eg. 60days or 1 day or 1 week etc). Please let me know the code. As per developers site, available presets: date_preset enum{today, yesterday, last_3_days, this_week, last_week, last_7_days, last_14_days, last_28_days, last_30_days, last_90_days, this_month, last_month, this_quarter, last_3_months, lifetime}

$params = array (
    'date_preset'=>'last_30_days',
    'data_columns'=>"['adgroup_id','actions','reach']",
);

?>
Amit
  • 65
  • 8

1 Answers1

2

You need to use the time range field. For example time_range={"since":"2016‌​-03-15","until":"2016-03-15"} as per this question

Community
  • 1
  • 1
noelnoegdip
  • 512
  • 1
  • 7
  • 22