Not able to retrieve campaign details

40 views
Skip to first unread message

Rahul Srinivasan Vengatesan

unread,
Apr 29, 2022, 8:03:10 AM4/29/22
to Google Ads API and AdWords API Forum
Hi,
I'm unable to retrieve campaigns using Google API. I'm also not getting errors in the response.

I'm only getting null response: Here is the code...

from google.ads.googleads.client import GoogleAdsClient
client = GoogleAdsClient.load_from_storage("google-adwords.yaml")

def stream_response(client, customer_id, query):
    return client.get_service("GoogleAdsService", version="v10").search_stream(customer_id, query=query)

try:
    ga_service = client.get_service("GoogleAdsService", version="v10")
    query = "SELECT campaign.name FROM campaign LIMIT 10"
    response = ga_service.search_stream(customer_id="1727960937", query=query)
    for batch in response:
            # Successfully iterate through response.
        for row in batch.results:
            print(
            f"Campaign with ID {row.campaign.id} and name "
            f'"{row.campaign.name}" was found.'
            )
except:
    print("error")

Please help.
Thanks

Google Ads API Forum Advisor

unread,
Apr 29, 2022, 3:08:13 PM4/29/22
to rveng...@thapovan-inc.com, adwor...@googlegroups.com
Hi Rahul,

Thank you for reaching out.

Could you provide us with the complete request and response logs with the request-id, so our team can better check?If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link. You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


ref:_00D1U1174p._5004Q2aOp4J:ref

Sreenivasan Gopal

unread,
May 5, 2022, 3:22:32 PM5/5/22
to Google Ads API and AdWords API Forum
I am experiencing the same issue in python. I am able to run the script but see no output or error. Please let me know how to resolve this 

Regards,
Sree 

Google Ads API Forum Advisor

unread,
May 6, 2022, 4:09:58 PM5/6/22
to sreeniva...@bluenile.com, adwor...@googlegroups.com

Hello Sree,

Thanks for reaching out. Could you please confirm if you tried the solution which my colleague Jinky shared with this thread? – “Upon checking the provided logs specifically the customer Id where you want to generate a report, I can see that the report is expected to not return any data and let me explain why. Please note that the campaign report can only be requested against the client account. However, I can see that you are requesting a report in an MCC account and this is the reason for the empty report. With this, try generating a report on a client account instead”.

If the issue still persists, then kindly share the updated request and response logs with us, so that our team may take a closer look at the issue you’re experiencing. Feel free to let us know if you have any further questions.

Best regards,

Google Logo
Jakeia Sabrina
Google Ads API Team
 

ref:_00D1U1174p._5004Q2aOp4J:ref

Google Ads API Forum Advisor

unread,
May 6, 2022, 4:12:22 PM5/6/22
to sreeniva...@bluenile.com, adwor...@googlegroups.com

Hello Sree,

Thanks for reaching out to the Google Ads API support. Could you please confirm if you tried the solution which my colleague Jinky shared with you? – “Upon checking the provided logs specifically the customer Id where you want to generate a report, I can see that the report is expected to not return any data and let me explain why. Please note that the campaign report can only be requested against the client account. However, I can see that you are requesting a report in an MCC account and this is the reason for the empty report. With this, try generating a report on a client account instead”.

If the issue still persists, then kindly share the updated request and response logs with us, so that our team may take a closer look at the issue you are experiencing. Please send the requested details via the Reply privately to the author option. If this option is not available, you may send the details directly to our googleadsapi-support@google.com alias by referring to this thread.



Feel free to let us know if you have any further questions.

Best regards,

Reply all
Reply to author
Forward
0 new messages