Getting KeywordText from KEYWORDS_PERFORMANCE_REPORT

55 views
Skip to first unread message

Robin

unread,
Jul 18, 2020, 5:56:41 AM7/18/20
to Google Ads Scripts Forum
The query:
 var report = AdsApp.report(
  'SELECT KeywordText, AdGroupId, Id, CpcBid, QualityScore, FirstPageCpc, TopOfPageCpc, FirstPositionCpc, KeywordMatchType ' + 
  'FROM KEYWORDS_PERFORMANCE_REPORT ' +
  'WHERE Status IN [ENABLED] ' +
  'AND AdGroupStatus IN [ENABLED] ' +
  'DURING LAST_7_DAYS');

Throws the following error: "Column 'KeywordText' is not valid for report type KEYWORDS_PERFORMANCE_REPORT. Double-check your SELECT clause. (file Code.gs, line 3)", while documentation on https://developers.google.com/google-ads/scripts/docs/best-practices#group_your_bulk_uploads_by_campaigns provides:
var report = AdsApp.report( 'SELECT KeywordText, Impressions, Clicks, Cost' + ' FROM KEYWORDS_PERFORMANCE_REPORT WHERE Clicks > 50 DURING' + ' LAST_MONTH');  
as an example (btw I tried, this query gives me the same error).

I can grab the keyword texts through the keyworditerator and match them using the ids, but that seems.. counterintuitive when using a report?

Anyone have a better idea on how to fetch the keyword text through a single report?


Dave Roeser

unread,
Jul 18, 2020, 3:47:25 PM7/18/20
to Robin via Google Ads Scripts Forum
Hi,
I found a hit from 2017...

Hi Brudur,

The script you are using is outdated. For your particular error, it is because the field KeywordText was replaced with the field Criteria. I found an updated version of the script here.

Please let me know if you have any issues.

Cheers,
Anthony
AdWords Scripts Team

********
Hope this helps.

Dave

--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/0bd2c176-c1be-4439-96bd-6455f0d59d42n%40googlegroups.com.

Robin

unread,
Jul 18, 2020, 4:35:31 PM7/18/20
to Google Ads Scripts Forum
Sweet. I did look it up myself, but not hard enough, tbh. Mildly infuriating though that the same thing is named differently depending on the method, and that the docs haven't been updated toi reflect the change since 2017.

Thanks!

Google Ads Scripts Forum Advisor

unread,
Jul 19, 2020, 9:37:40 PM7/19/20
to adwords...@googlegroups.com
Hi,

Dave, thank you for giving suggestion to Robin.

Robin, your observation is correct that the entities are named differently in script and report. But I would suggest looking at 'Display Name' of each field of the report as it is specified there the equivalent of this field on the UI.

Feel free to post your further concerns on this forum.

Regards,
Ejay
Google Ads Scripts Team

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