Cannot see the result from request

105 views
Skip to first unread message

Qihuai Duan

unread,
May 10, 2023, 5:37:48 AM5/10/23
to Google Ads API and AdWords API Forum
Hello,

I had executed my first request in Python for test, using service account, with the code below :

AUTH_PATH="lib/google-ads.yaml"
client = GoogleAdsClient.load_from_storage(AUTH_PATH)
ga_service=client.get_service("GoogleAdsService",version="v13")

query = """
SELECT
campaign.id,
ad_group.id,
ad_group.name
FROM ad_group
"""

search_request = client.get_type("SearchGoogleAdsRequest")
search_request.customer_id = customer_id
search_request.query = query
# search_request.page_size = _DEFAULT_PAGE_SIZE

results = ga_service.search(request=search_request)

for row in results:
    print(
        f"Ad group with ID {row.ad_group.id} and name "
        f'"{row.ad_group.name}" was found in campaign with '
        f"ID {row.campaign.id}."
    )

The request worked but it did not show the results. While I check the results, it was masked

SearchPager<field_mask { paths: "campaign.id" paths: "ad_group.id" paths: "ad_group.name" } >

How could I solve this problem pls ?

Thx

Google Ads API Forum Advisor

unread,
May 10, 2023, 11:58:25 AM5/10/23
to qih...@primelis.com, adwor...@googlegroups.com

Hi Qihuai,

Thank you for reaching out to us.

With regard to your concern, for us to further check this can you confirm if you're seeing data in the UI but unable to get results in the API? If this is the case, can you provide us with complete request and response logs with request ID so we can further investigate? If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Python) > Logging documentation, which you can access from this link. You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com.

In addition to that, you may also check the sample code for Python (https://developers.google.com/google-ads/api/docs/reporting/example#python) for reference.

Reference links:

Regards,
Google Logo Google Ads API Team


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