Reputation: 204
I'm using Facebook Ads API SDK for PHP (Marketing API Version 2.3) In order to retrieve all the information I can get From Ads Which I created.
I already made a connection and managed to get the info about Insights,Statistics and reach estimate of ads but the problem is when I'm trying to read the info from the adCreative all the returning info is NULL!
this is the code:
$adgroup = new AdGroup($ad_set_id);
$target=$adgroup->getAdCreatives();
$arr_obj=$target->getObjects();
$toPrint1=$arr_obj[0];
var_dump($toPrint1->getData());
Upvotes: 1
Views: 508
Reputation: 204
I found the Solution. The reason I did not get all the information about the ads is because in Facebook with the objective of Mobile or App Install all the Info is Stored in Object "Unpublished Page Posts".
for retrieving the info:
1) get Ad Creative as written in Facebook Marketing API.
**** it's very important to Specify 'object_story_id' field in the fields array you wish to retrieve***
2) use curl call to fetch the info as written in FB developer: /docs/marketing-api/unpublished-page-posts/v2.3#read
example:
curl https://graph.facebook.com/<API_VERSION>/<object_story_id>/
Upvotes: 1