1
votes

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());
  • I only need the Body and the Title
  • I checked this with tens of different adSet ID
  • All the adSet ID are Active and there fields are full with information
  • I tried to add img but I couldn't because I'm new user
1
Help please.....8.-) - Idan Petel

1 Answers

1
votes

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>/