Re: Google ads api ad data

160 views
Skip to first unread message
Message has been deleted

pmoe...@binaerpark.de

unread,
Jul 8, 2022, 7:10:26 AM7/8/22
to Google Ads API and AdWords API Forum
Try your query here:

Fix your query to address the errors below and re-submit.

  • 'ad_group_ad.name' is not a valid field in the SELECT clause when 'ad_group_ad' is the resource in the FROM clause. Fields in the SELECT must be 'Selectable'.
  • 'ad_group_ad.text_ad' is not a valid field in the SELECT clause when 'ad_group_ad' is the resource in the FROM clause. Fields in the SELECT must be 'Selectable'.
  • 'ad_group_ad.expanded_text_ad' is not a valid field in the SELECT clause when 'ad_group_ad' is the resource in the FROM clause. Fields in the SELECT must be 'Selectable'.

You can also click very easily your query from start:
ad_group_ad.resource_name, 
ad_group_ad.ad.expanded_text_ad.headline_part1, 
ad_group_ad.ad.expanded_text_ad.headline_part2, 
ad_group_ad.ad.expanded_text_ad.headline_part3, 
ad_group_ad.ad.expanded_text_ad.description, 
ad_group_ad.ad.expanded_text_ad.description2, 
ad_group_ad.ad.text_ad.headline, 
ad_group_ad.ad.text_ad.description1, 
ad_group_ad.ad.text_ad.description2 
FROM ad_group_ad


marwen...@esprit.tn schrieb am Freitag, 8. Juli 2022 um 11:28:05 UTC+2:
Hello There,

I'm trying to query the ad entity mentioned in the google ads api documentation (https://developers.google.com/google-ads/api/reference/rpc/v10/Ad
using this code : (I will mention just some of my code)

query = """
        SELECT
        Ad.id
        FROM Ad """
    stream = ga_service.search(customer_id=customer_id, query=query)

And I'm getting   message: "Unrecognized field in the query: \'Ad.id\'." ( for all fields)
Can someone help with this ? 


 I did even change my query and it works for id but it not working for other fields:
 query = """
        SELECT
        ad_group_ad.ad.id,
        ad_group_ad.resource_name,
        ad_group_ad.name,
        ad_group_ad.text_ad,
        ad_group_ad.expanded_text_ad
         FROM ad_group_ad  """

message: "Unrecognized fields in the query: \'ad_group_ad.text_ad\', \'ad_group_ad.name\', \'ad_group_ad.expanded_text_ad\'."
( I need to get ads data from the api)

Thank you in advance.

Google Ads API Forum Advisor

unread,
Jul 8, 2022, 11:43:36 AM7/8/22
to pmoe...@binaerpark.de, adwor...@googlegroups.com
Hi Marwen,

The query builder could indeed help in constructing your GAQL that you can later on use directly in your API requests. That said, could you confirm as well if you are still encountering issues when constructing your queries?

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


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