AdCustomizers download FeedItems target adGroupId and campaignId

25 views
Skip to first unread message

Paris Theofanidis

unread,
May 3, 2017, 4:32:12 PM5/3/17
to AdWords API Forum
I have a feed with AdCustomizers that was created using the AdCustomizerFeedService and was populated using the FeedItemService.
I am now downloading the feed items of the customizers and then I am trying to download the related AdGroupId using the AdGroupFeedService and the related CampaignId using the CampaignFeedService..

To get the AdGroupIds my selector looks like this

$selector = new Selector();
$selector
 
->setFields(['FeedId', 'AdGroupId', 'MatchingFunction', 'Status'])
 
->setPredicates([
 
new Predicate('FeedId', PredicateOperator::IN, [51940371]),
 
new Predicate('PlaceholderTypes', PredicateOperator::EQUALS, [10]),
 
])
 
->setPaging(new Paging(0, 5000));

The result is always empty. Is there some other service I should be using to download the related AdGroupId or there's something wrong with my selector?
Similar with when trying to retrieve the CampaignId of feed items (my selector for CampaignIds is very similar, just replace AdGroupId field with CampaignId) I again get not results.
(however, very similar code works perfectly fine with Sitelinks feeds, just by changing placeholder type to 1)

Ivan Bautista

unread,
May 4, 2017, 2:43:40 AM5/4/17
to AdWords API Forum
Hi Paris, 

Please note that AdGroupFeedService is used to link a feed to an AdGroup using a matching function. Having said that, the Feed Id and Ad Group Id associated with your Ad customizer will only be returned from AdGroupFeedService.get() if they are properly linked with a matchingFunction.

If you only need the associated Feed Ids and AdGroup Ids of all of your Ad customizers, then you can retrieve all Feed Ids via AdCustomizerFeedService and use those Feed Ids to traverse through FeedItemService.get() and get the TargetingAdGroupId (if you set a targeted AdGroup Id upon creation of feed items). Similar flow should be done to retrieve Campaign Ids but you will use TargetingCampaignId instead.

Let me know if this helps.

Regards,
Ivan 
AdWords API Team
Reply all
Reply to author
Forward
0 new messages