GoogleAdsServiceClient recommendation request got stuck without any response.

449 views
Skip to first unread message

Suresh Kumar Shenbagam

unread,
Nov 5, 2019, 5:06:47 AM11/5/19
to AdWords API and Google Ads API Forum
Hi Team,

I am trying to retrieve recommendations using google ads API as mentioned here - https://developers.google.com/google-ads/api/docs/samples/get-text-ad-recommendations
The authentication was successful, but there was no response - it got stuck in the searchrequest. I am using test account - but any way it should return atleast empty recommendation.

I can send you the customer id privately, if required. Please let me know.

Suresh

Google Ads API Forum Advisor Prod

unread,
Nov 5, 2019, 12:46:05 PM11/5/19
to suresh.s...@cloudsense.com, adwor...@googlegroups.com

Hi Suresh,

Thank you for writing to us. With regards to your concern, you are right and you should be receiving an empty response while getting the recommendations for your ads in the test accounts. Can you please confirm if you observing any timeout or bad request error while making this call against your account? If yes, could you please elaborate more on the error message received? If not, could you please share the request and response logs along with client customer id privately for me to assist you better? Please use Reply privately to author option while sharing the details.

Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UMWG5I:ref

Suresh Kumar Shenbagam

unread,
Nov 6, 2019, 2:38:32 AM11/6/19
to AdWords API and Google Ads API Forum
Hi Nikisha,

Thanks for the response.  I have sent you the customerid as private message. And also, I am trying to list all the customer using Google Ads API as mentioned in the example here - https://developers.google.com/google-ads/api/docs/account-management/listing-accounts 

Authentication was success. But there is no response from this line,
ListAccessibleCustomersResponse response =
customerService.listAccessibleCustomers(
ListAccessibleCustomersRequest.newBuilder().build());

Is there any problem with GoogleAdsClient - Can you please check and let me know.
Btw, am able to retrieve customers using adwords api. I wanted to use the recommendation services, so I chose Google Ads API.


Suresh

Google Ads API Forum Advisor Prod

unread,
Nov 6, 2019, 11:00:05 AM11/6/19
to suresh.s...@cloudsense.com, adwor...@googlegroups.com

Hi Suresh,

Thank you for sharing the client customer id. I took a closer look into your account and found that you are trying to making the API call against your test manager account. Could you please try making the API request call to get the text ads recommendation against the client customer account and let me know if you are still having any issues? For your other concern related to ListAccessibleCustomers, this service returns the list of customers based on your OAuth credentials and the accounts that you are able to act upon directly with your current credentials. Could you please confirm the OAuth credentials are generated using the email address having direct access to the accounts? If yes, could you please share the email address privately for me to investigate this further on my end?



Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UMWG5I:ref

Kera Hartlen

unread,
Nov 11, 2019, 7:15:45 AM11/11/19
to AdWords API and Google Ads API Forum
I have a similar issue. I am currently still running the get_campaigns.py example in my console. It's been running for over an hour. The data is not that high in volume. I can successfully return the data in Google Sheets with the Google Ads Add-On. I specified the customer ID in the code (not the manager account ID). I am running on a test developer token. The client is in my manager account. However, is the reason it is just running without completing because I am using a test developer token? I am authenticated without any issues. I am using the google-ads python library. My file looks like this:(Note: I have blanked out the customer ID as we have NDA contracts and GDPR to comply with.) I have pulled from several different APIs and this has by far been the most ridiculous headache I have ever experienced with one.

#!/usr/bin/env python
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""This example illustrates how to get all campaigns.
To add campaigns, run add_campaigns.py.
"""

from __future__ import absolute_import

import argparse
import six
import sys

import google.ads.google_ads.client


_DEFAULT_PAGE_SIZE = 1000
customer_id="xxx-xxx-xxxx"


def main(client, customer_id, page_size):
ga_service = client.get_service('GoogleAdsService', version='v2')

query = ('SELECT campaign.id FROM campaign ORDER BY campaign.id')
results = ga_service.search(customer_id, query=query, page_size=page_size)

try:
for row in results:
print('Campaign with ID %d and name "%s" was found.'
% (row.campaign.id.value))
except google.ads.google_ads.errors.GoogleAdsException as ex:
print('Request with ID "%s" failed with status "%s" and includes the '
'following errors:' % (ex.request_id, ex.error.code().name))
for error in ex.failure.errors:
print('\tError with message "%s".' % error.message)
if error.location:
for field_path_element in error.location.field_path_elements:
print('\t\tOn field: %s' % field_path_element.field_name)
sys.exit(1)


if __name__ == '__main__':
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
google_ads_client = GoogleAdsClient.load_from_storage(path='E:/Work/AWAPI/venv/google-ads.yaml')

parser = argparse.ArgumentParser(
description='Lists all campaigns for specified customer.')
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
required=True, help='The Google Ads customer ID.')
args = parser.parse_args()

main(google_ads_client, args.customer_id, _DEFAULT_PAGE_SIZE)

Google Ads API Forum Advisor Prod

unread,
Nov 11, 2019, 10:05:48 AM11/11/19
to ke...@covalentbonds.com, adwor...@googlegroups.com

Hi Kera,

Thank you for writing to us. To assist you better, could you please share the complete request and response logs along with the client customer against which you are making the API request call to get the campaign details? Please use Reply privately to author option while sharing the details.



Regards,
Nikisha Patel, Google Ads API Team



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