php - Reading Ad set fields with targeting in Facebook marketing API -
i have using marketing api version 2.6. in 2.5 version can use field targeting retrieve ads in ad set. in 2.6, field targeting not supported. wanna retrieve age_min, age_max, geo_locations, , page_types. how retrieve targeting fields in ad set? code have using fields
if(is_null(access_token) || is_null(app_id) || is_null(app_secret)) { throw new \exception( 'you must set access token, app id , app secret before executing' ); } if (is_null(account_id)) { throw new \exception( 'you must set account id before executing'); } api::init(app_id, app_secret, access_token); $adset = new adset($adsetid); $fields = array('name', 'targeting', 'creative', 'conversion_specs', 'redownload', 'genders', 'tracking_specs'); $result = $adset->getads($fields, $limit);
maybe $result = $adset->read($fields); should work?
i think "getads" gets ads under adset. looks interested in adset's fields, not ads under adset.
Comments
Post a Comment