When getting Ads from Facebook using the php sdk like this:
$params = array(
'time_range' => array(
'since' => date('Y-m-d', strtotime('-7 days')),
'until' => date('Y-m-d', strtotime('-1 days')),
),
'limit' => 10,
'time_increment' => 1,
);
$ads = $account->getAds(
array(
AdFields::ID,
AdFields::ADSET_ID,
AdFields::NAME,
AdFields::ADLABELS,
AdFields::CREATED_TIME
),
$params
);
The returned ads array contains elements with create_time back to february
It seems like the params are completely ignored.
According to the Facebook docs (https://developers.facebook.com/docs/marketing-api/reference/adgroup/#parameter)
and also the sdk Code
it seems like time_range should be supported.
Any clues on why my output array does not reflect my params
These are the open issues i found: https://developers.facebook.com/community/threads/592418868011048/
$params = array( 'time_range[since]' => date('Y-m-d', strtotime('-2 days')), 'time_range[until]' => date('Y-m-d', strtotime('-1 days')), 'limit' => 1000, 'time_increment' => 1, );Unfortunately, the resulted output number does not change