AdsApp Report WHERE clause not working

73 views
Skip to first unread message

Pascal

unread,
Mar 2, 2020, 8:00:54 AM3/2/20
to Google Ads Scripts Forum
Hi,

I'm trying to run a Query Report on an account from the SEARCH_QUERY_PERFORMANCE_REPORT and retrieve all search terms that have a cost > 50 during the last 30 days. However, for some reason, it also returns search terms with a cost lower than 50. Could anyone help me out? The query I'm running is as follows:

SELECT CampaignName, CampaignId, AdGroupName, AdGroupId, Query, QueryTargetingStatus, Impressions, Clicks, Ctr, Cost, AverageCpc, Conversions, CostPerConversion, ConversionValue FROM SEARCH_QUERY_PERFORMANCE_REPORT WHERE CampaignStatus = ENABLED AND AdGroupStatus = ENABLED AND QueryTargetingStatus = NONE AND Cost > 50 DURING LAST_30_DAYS

Google Ads Scripts Forum Advisor

unread,
Mar 2, 2020, 2:31:18 PM3/2/20
to adwords-scripts+apn2wqf-rlvfh-_h...@googlegroups.com, adwords-scripts+apn2wqf-rlvfh-_h...@googlegroups.co, adwords...@googlegroups.com
Hello,

Can you please confirm that you are running this query with Ads scripts?

If so, can you please provide your CID and script name so we can look at the issue in the account?

Thanks,
Matt 
Google Ads Scripts Team

ref:_00D1U1174p._5001UXTne4:ref

Pascal

unread,
Mar 3, 2020, 2:58:57 AM3/3/20
to Google Ads Scripts Forum
Hi Matt,

Thanks for your reply. I am indeed running it from Ads Scripts. The script is running on multiple accounts from the following MCC: 566-933-2339

The script name is: 'Search terms potential negatives'

Thanks in advance!

Google Ads Scripts Forum Advisor

unread,
Mar 3, 2020, 4:01:45 AM3/3/20
to adwords...@googlegroups.com
Hi Pascal,

Thank you for providing further details. I am a colleague of Matt and let me provide further support to your concern.

However, could you please provide the following details so that I can take a closer look? You can provide the requested details via Reply privately to author option.
1. Name of the script where the Search Query Performance Report has been implemented
2. The sample client accounts where you've noticed the issue
3. Screenshot of the search terms that the cost are less than 50 but have been included in the report.

Regards,
Ejay

Nils Rooijmans

unread,
Mar 3, 2020, 1:59:19 PM3/3/20
to Google Ads Scripts Forum
Hi Pascal,

this is probably due to this part of your query: 'Cost > 50'

the Cost metric is in micros, see:  

So for $50 or €50 you would need to multiply by 1000000 and thus use 'Cost > 50000000'


Hope this helps, 

Nils Rooijmans 
See my Google Ads Scripts FAQ to avoid the same mistakes i made: https://nilsrooijmans.com/google-ads-scripts-faq/

Google Ads Scripts Forum Advisor

unread,
Mar 3, 2020, 3:31:11 PM3/3/20
to adwords-scripts+apn2wqdcy_i_uoul...@googlegroups.com, adwords...@googlegroups.com
Hi Nils,

Thanks for your contribution, as always.

Pascal - though the report will not output the cost in terms of micros, your query is describing cost in terms of micros (e.g. 50 in terms of your currency, is 50,000,000 in micros).

Regards,
Matt

Pascal

unread,
Mar 4, 2020, 3:20:26 AM3/4/20
to Google Ads Scripts Forum
Hi Nils,

Thanks for your reply, problem solved! Is there any documentation on micros? I was not aware of this multiplication factor.

Google Ads Scripts Forum Advisor

unread,
Mar 4, 2020, 5:08:55 AM3/4/20
to adwords...@googlegroups.com
Hi Pascal,

I am happy to know that your script is now working.

This is the base document which you can read to have more information about the reporting on Google Ads scripts. As for your current question, this is the specific document that discussed the money fields in reports, returned in micro currency units (micros).

Let me know if you have further questions.

Regards,
Ejay

Pascal

unread,
Mar 4, 2020, 5:24:33 AM3/4/20
to Google Ads Scripts Forum
Thanks a lot Ejay.
Reply all
Reply to author
Forward
0 new messages