How to select a specific ad using AdGroupId and Id ? ...

22 views
Skip to first unread message

BDCoder

unread,
Sep 11, 2014, 3:08:58 PM9/11/14
to adwor...@googlegroups.com
Hello,

All I want to do is use the AdGroupAdService to get a single text ad with a specific ID in a specific AdGroup.   My understanding is that the (AdGroupId, AdId) pair is globally unique; so I assume I have to pass the AdGroupID and AdId to the selector.

However, when I perform a get using the AdGroupAdService using these predicates:

AdGroupId = the_ad_group_id

Id = the_ad_id

The API always returns Nothing (i.e.: the ad ID does not exist) -- but I have verified it does exist within the group id and ad id I am passing it (by listing all ads in the group).

Am I missing something?, does any code example exist that allows us to get a single ad rather than all ads in a group?



BDCoder

unread,
Sep 11, 2014, 3:40:25 PM9/11/14
to adwor...@googlegroups.com
AH-HA ... 

From the documentation -- AdGroupAds that had been removed are not returned by default.

Of course!!  -- the ad ID I was trying to fetch was DISABLED -- which I guess is synonym for "removed" in this API world (who knew?)

So -- to work with this "feature", simply add another predicate to your selector, i.e.:

status IN ( DISABLED, ENABLED, PAUSED )

So that the get operation will return the ad regardless of its status !!

Solved.


Reply all
Reply to author
Forward
0 new messages