I can get user interest targets of a Adgroup, there i can get interest id, name and other, but parent id is not returned, however i added this in selectors, attached selector code and response below,
Selector:
$adGroupId = intval($adGroupId);
$targetData = array();
$session = self::setSession();
$adWordsServices = new AdWordsServices();
$adGroupCriterionService = $adWordsServices->get($session, AdGroupCriterionService::class);
$selector = new Selector();
$selector->setFields(['Id', 'Text', 'CriteriaType', 'UserInterestParentId']);
$selector->setPredicates(
[
new Predicate('AdGroupId', PredicateOperator::IN, [$adGroupId]),
new Predicate(
'CriteriaType',
PredicateOperator::IN,
[
'USER_INTEREST',
'CUSTOM_AFFINITY'
]
)
]
);
Response:
[0] => Google\AdsApi\AdWords\v201809\cm\BiddableAdGroupCriterion Object
(
[userStatus:protected] =>
[systemServingStatus:protected] =>
[approvalStatus:protected] =>
[disapprovalReasons:protected] =>
[firstPageCpc:protected] =>
[topOfPageCpc:protected] =>
[firstPositionCpc:protected] =>
[qualityInfo:protected] =>
[biddingStrategyConfiguration:protected] =>
[bidModifier:protected] =>
[finalUrls:protected] =>
[finalMobileUrls:protected] =>
[finalAppUrls:protected] =>
[trackingUrlTemplate:protected] =>
[finalUrlSuffix:protected] =>
[urlCustomParameters:protected] =>
[adGroupId:protected] => 110335323727
[criterionUse:protected] => BIDDABLE
[criterion:protected] => Google\AdsApi\AdWords\v201809\cm\CriterionUserInterest Object
(
[userInterestId:protected] => 92505
[userInterestParentId:protected] =>
[userInterestName:protected] => Beauty Mavens
[id:protected] => 51668104135
[type:protected] => USER_INTEREST
[CriterionType:protected] => CriterionUserInterest
[parameterMap:Google\AdsApi\AdWords\v201809\cm\Criterion:private] => Array
(
[Criterion.Type] => CriterionType
)
)
[labels:protected] =>
[forwardCompatibilityMap:protected] =>
[baseCampaignId:protected] =>
[baseAdGroupId:protected] =>
[AdGroupCriterionType:protected] => BiddableAdGroupCriterion
[parameterMap:Google\AdsApi\AdWords\v201809\cm\AdGroupCriterion:private] => Array
(
[AdGroupCriterion.Type] => AdGroupCriterionType
)
)