Troubles with Google Ads API Documentation

46 views
Skip to first unread message

Ataina00

unread,
Mar 12, 2022, 6:18:21 AM3/12/22
to Google Ads API and AdWords API Forum
Hello, 
It's my first time using google ads api and I'm a little lost with what we can and can't do. 
I want to use the google ads API in order to exclude automatically from the category "Where ads showed" some placements that met certain criteria. 

But in your documentation I can't see anything that can help me doing that. 

I tried this little script as a test  : 
function main() {
  removePlacement();
 
  function removePlacement() {
    var placementSelector = AdsApp.display().placements();
   
    var placementIterator = placementSelector.get();
    while (placementIterator.hasNext()) {
      var placement = placementIterator.next();
      var placementUrl = placement.getUrl();
      var campaign = placement.getCampaign();
      var regex = /[\u0600-\u06FF]/;
      var regexC = /[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff66-\uff9f]/;
      if (placement.match(regex)) {
        Logger.log ("La campagne contient des emplacements avec des termes arabes")
      }
    }
}
}

Can you provide some more insights ? I thought it was because initially I was planning to use the google ads script and with Google Ads API I will have more possibilities. 

Thank you in advance ! 

Google Ads API Forum Advisor

unread,
Mar 14, 2022, 1:54:21 AM3/14/22
to tainaedo...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for raising this concern to Google Ads API team.

In order for you to get the placements from the "WHERE ADS SHOWED" that can be seen in the Google Ads UI, you need to use the group_placement_view. Then, if you want to exclude the placements retrieved by the said report type, you need to use the AdGroupCriterionService for ad group level and CampaignCriterionService for campaign level via Google Ads API.

Let us know if you have any questions.

Regards,
Google Logo
Carmela
Google Ads API Team
 


ref:_00D1U1174p._5004Q2YkgXn:ref
Reply all
Reply to author
Forward
0 new messages