Ad Performance Script Error

346 views
Skip to first unread message

Ivan Velazquez

unread,
Jul 16, 2024, 2:41:37 PM7/16/24
to Google Ads Scripts Forum
Hello, I recently started getting error messages when attempting to run the ad performance script across various accounts. 

The report seems to generate the spreadsheet according the requested schedule (daily) but one of the errors I keep getting seems to prevent the report from generating. 

Below is the message I keep seeing. Has the script recently changed?

I have also deleted the script from my our accounts, and tried the template installation directly inside of each Google Ad but I get the same error message once I try running the script. 


7/15/2024 1:01:39 PM

Ca: QueryError.UNRECOGNIZED_FIELD: Unrecognized fields in the query: 'ad_group_ad.ad.discovery_carousel_ad.headline', 'ad_group_ad.ad.discovery_multi_asset_ad.headlines'. at outputSegmentation (Code:123:14) at main (Code:29:3)

Google Ads Scripts Forum Advisor

unread,
Jul 16, 2024, 2:57:46 PM7/16/24
to adwords...@googlegroups.com

Hi,

Thank you for reaching out to the Google Ads Scripts support team.

I would like to inform you that the metrics 'ad_group_ad.ad.discovery_carousel_ad.headline', and 'ad_group_ad.ad.discovery_multi_asset_ad.headlines' are deprecated from “ad_group_ad” in API version 17. In order to resolve this issue, I would suggest that you replace your code from 

const results = AdsApp.search(`SELECT ${fields} FROM ad_group_ad ` + `WHERE metrics.impressions > 0 AND ` + `segments.date DURING LAST_7_DAYS`,);

with 

const results = AdsApp.search(`SELECT ${fields} FROM ad_group_ad ` + `WHERE metrics.impressions > 0 AND ` + `segments.date DURING LAST_7_DAYS`,{apiVersion: 'v16'});

Alternatively, you can remove both the 'ad_group_ad.ad.discovery_carousel_ad.headline', and 'ad_group_ad.ad.discovery_multi_asset_ad.headlines' fields from the Config object to resolve this error.

I hope this helps! Kindly contact us with the below details if you still face any issues.

  • Google Ads account ID/CID
  • Name of the affected script
  • Shareable spreadsheet link that you are using in the script
You can share the requested details via Reply privately to the author option or a direct private reply to this email. If this option is not available on your end, you may send it through our email (googleadsscr...@google.com) instead.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vDhNd:ref" (ADR-00252500)

Thanks,
 
Google Logo Google Ads Scripts Team


Ivan Velazquez

unread,
Jul 16, 2024, 3:32:51 PM7/16/24
to Google Ads Scripts Forum
Hello, thank you for responding so quickly and providing a solution. I have updated the code as recommended by replacing const results = AdsApp.search(`SELECT ${fields} FROM ad_group_ad ` + `WHERE metrics.impressions > 0 AND ` + `segments.date DURING LAST_7_DAYS`,); with const results = AdsApp.search(`SELECT ${fields} FROM ad_group_ad ` + `WHERE metrics.impressions > 0 AND ` + `segments.date DURING LAST_7_DAYS`,{apiVersion: 'v16'}); which took care of the issue. 

As a future update, can the team update the script so the report includes headline and description performance?

Thanks for your help!

Ivan



Google Ads Scripts Forum

unread,
Jul 16, 2024, 3:39:33 PM7/16/24
to Google Ads Scripts Forum
Internal: Re-posting the last inquiry https://groups.google.com/g/adwords-scripts/c/6rQS64_uC7s, as the corresponding case was not updated.

Google Ads Scripts Forum

unread,
Jul 16, 2024, 3:51:37 PM7/16/24
to Google Ads Scripts Forum
Hi,
I would like to inform you that the reporting fields are related to the Google Ads API and the Google Ad Script uses API integration for reporting. As the inclusion of the additional fields in reporting is related to the API, I would recommend that you reach out to the Google Ads API team for further assistance.

Ivan Velazquez

unread,
Jul 16, 2024, 4:26:21 PM7/16/24
to Google Ads Scripts Forum
Hello, 
Thank you for clarifying. I will contact the Google Ads API team to ask about updating the reporting API to include ad description performance. 
Reply all
Reply to author
Forward
0 new messages