How to filter out removed Ads?

17 views
Skip to first unread message

Juan Pablo Gardella

unread,
Apr 22, 2019, 2:12:02 AM4/22/19
to AdWords API and Google Ads API Forum
Hello all,

I need to filter out removed Ads when I retrieve AdGroup objects. The removed Ads are easily to detect using the Web UI


But when I want to determine the Ad status using the API, I'm unable to determine that. For example if I query the AdGroups using the following code in Java

    Selector selectorAds = builder.fields(AdGroupAdField.Id, AdGroupAdField.AdGroupId,
       
AdGroupAdField.AdType, AdGroupAdField.Status, AdGroupAdField.BaseCampaignId,
       
AdGroupAdField.CreativeFinalUrls).offset(offset).limit(PAGE_SIZE).equals(
           
AdGroupAdField.BaseCampaignId, Objects.toString(646465621L)).build();
// do the query

The selector returns all the AdGroup's Ad objects. For example, below Ad is removed.



       
<getResponse xmlns="https://adwords.google.com/api/adwords/cm/v201809">
           
<rval>
               
<totalNumEntries>24</totalNumEntries>
               
<Page.Type>AdGroupAdPage</Page.Type>
               
<entries>
                   
<adGroupId>34810610889</adGroupId>
                   
<ad xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="TextAd">
                       
<id>116841139809</id>
                       
<type>TEXT_AD</type>
                       
<Ad.Type>TextAd</Ad.Type>
                   
</ad>
                   
<status>ENABLED</status>
                   
<baseCampaignId>646465621</baseCampaignId>
               
</entries>

How can I determine if an Ad is removed or not using the API?


Thanks

googleadsapi...@google.com

unread,
Apr 22, 2019, 6:20:18 AM4/22/19
to adwor...@googlegroups.com, AdWords API and Google Ads API Forum
Hi Juan,

Could you clarify if my understanding is correct that the ads with 'REMOVED' status was included in the API response? If yes, the ads with "PAUSED" and "ENABLED" statuses are the only ads that will be included in the API response unless you implemented the filter below in your selector.

.in(AdGroupAdField.Status, "ENABLED", "PAUSED", "DISABLED")

However, it seems that you haven't set the filter specified above but the specific ads with 'removed' status was included in the API response. With this, could you provide the complete SOAP request and response logs together with the customer ID so I can further investigate it.

Regards,
Ejay
Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/a165861f-7a1a-4f14-aaf9-4f0a9bb393f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages