Adwords API, CampaignCriterionService migrate to Googe Ads API

114 views
Skip to first unread message

jubap...@gmail.com

unread,
Mar 11, 2022, 6:06:51 PM3/11/22
to Google Ads API and AdWords API Forum
Hi, 
I want to get campaign criteria by selector fields using python code.
I am using the paging method: 
page = campaign_criterion_service.get(selector)
selector = {
       'fields': ['CampaignId', 'Id', 'CriteriaType', 'PlatformName',
                  'LanguageName', 'LocationName', 'KeywordText','IsNegative','KeywordMatchType',
                  'UserListId','UserListName','BidModifier','CampaignCriterionStatus','BaseCampaignId'],
       'paging': {
             'startIndex': str(offset),
             'numberResults': str(PAGE_SIZE)
            },
       'predicates': [{
           'field': 'CampaignId',
           'operator': 'IN',
           'values':campaignidlist
       },{
           'field': 'IsNegative',
           'operator': 'EQUALS',
           'values': str(isNegative)
       },
       {
           'field': 'CriteriaType',
           'operator': 'EQUALS',
           'values': CriteriaType
       }]
     }
Now I want to migrate those to Google Ads API. I know that the report service has a resource mapping document. However, the service only has a corresponding service without a mapping selector form.
I used SearchGoogleAdsStreamRequest to get the data frame and construct them to operations. for a service call.
Like I know for GAQL campaign id is campaign.id,  Id in this file is campaign_criterion.criterion_id. 
But I couldn't find 'PlatformName', 'LanguageName', 'LocationName', in campaing criterion table. https://developers.google.com/google-ads/api/docs/migration/mapping#campaign_criteria

If I want to use SearchGoogleAdsStreamRequest to get the form with those selectors, 
is there an easier way to map the corresponding GAQL? 

Thank you

Google Ads API Forum Advisor

unread,
Mar 14, 2022, 12:32:03 PM3/14/22
to jubap...@gmail.com, adwor...@googlegroups.com
Hi Juba,

Thank you for reaching out to the Google Ads API support team.

You can perform a separate request using the geo_target_constant report and see Geo Targets documentation should also be able to provide information on the Criteria ID to Canonical Name mapping of location IDs. You can then filter using Target Type = City to map city locations. The Target Type = City location criteria should return in the reports its respective Name or Canonical Name (columns) from the geo targets csv. You can query all of that info from the  campaign_criterion report and you can pull fields from the reports in the "attributed resources”. To retrieve LanguageName, you can use language_constant.name filed form language_constant report. Let me know if you have any question.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


ref:_00D1U1174p._5004Q2Ykaz6:ref

cv

unread,
Nov 7, 2022, 1:06:50 AM11/7/22
to Google Ads API and AdWords API Forum
Hi Nirmita,

This is not ideal way If we can have large Geo sets.
In my case I pull the data daily in that If Geo sets are large then it is difficult to map each ID with respective name. and It is time consuming.

In Adwords API we are getting name along side ID which is missing in google Ads API.

Thanks,

Google Ads API Forum Advisor

unread,
Nov 7, 2022, 6:15:36 AM11/7/22
to chirag....@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for the reply.

Since you mentioned that "In Adwords API we are getting name along side ID", allow me to raise a feature request for this. However, there is no guarantee if this will be supported soon. With that, we recommend that you follow our blog for updates and new releases.

Best regards,
Google Logo
Heidi
Google Ads API Team
 


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