Alternate for get_service while migrating to. Google Ads API

530 views
Skip to first unread message

Deepak Kumar

unread,
Apr 14, 2022, 12:00:48 AM4/14/22
to Google Ads API and AdWords API Forum
Hi,
I am trying to update the existing code to use Google Ads API but I am not able to find the alternate for get_service object as it not a part of the current API.

AttributeError: 'GoogleAdsServiceClient' object has no attribute 'get_service'

Can you help me on the same?

Thanks

Google Ads API Forum Advisor

unread,
Apr 18, 2022, 2:59:35 AM4/18/22
to deepak...@gmail.com, adwor...@googlegroups.com

Hi there,

Thanks for reaching out to the Google Ads API Forum.

Could you confirm if you’re using current version as v10? If so, in the Google Ads API V10 version, GET methods have been removed from all services. Any service that exclusively had a get method has been removed as well. The primary way to retrieve objects continues to be using GoogleAdsService's search and searchStream methods. For a comprehensive overview of changes based from v9 to v10, you may refer to this page, and inspecting objects with get (Deprecated) is deprecated since the usage of "get" in this API was only intended for exploratory purposes and not actually retrieving data as mentioned here

Instead, you may use GoogleAdsService, since it lets you retrieve only specific attributes of objects, supports retrieving performance metrics, and allows for streaming through large result sets.

If you haven’t recieved error on v10, you may send complete logs to us via reply to author privately option, so that we can check better.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2a384H:ref

Deepak Kumar

unread,
Apr 18, 2022, 5:46:40 AM4/18/22
to ads...@forumsupport.google, adwor...@googlegroups.com
Hi Yasar,

I have one question then, earlier I was querying the audience id and then adding only users that were not present in google adwords list. But since, get methods have been removed, I can't get the audience id for existing users. Then shall I send all the users and google would take care of existing users from there or how is it structured?

Thanks,
Deepak Kumar

Google Ads API Forum Advisor

unread,
Apr 19, 2022, 2:32:17 AM4/19/22
to deepak...@gmail.com, adwor...@googlegroups.com

Hi Deepak,

Thanks for getting back to us.

If you’re looking to get the audience id(user_list.id), you may use the user_list report and get the user_list.id field. However, could you please elaborate on your query further “Then shall I send all the users and google would take care of existing users from there or how is it structured?”?

Regards,

Reply all
Reply to author
Forward
0 new messages