Get items count on result row search stream.

976 views
Skip to first unread message

Boris DETRY

unread,
Feb 3, 2022, 6:03:31 AM2/3/22
to Google Ads API and AdWords API Forum
Since segmentation with new API skips the results with no segment, I need to run some extra request and extra code. For example, concatenating search terms with and without keywords... my code execution could take hours for accounts with millions of search terms. 

My question is if it's possible to have the total result count (the quantity of elements) when I request the search stream method with "TotalRowOnly" as parameter ?

Google Ads API Forum Advisor

unread,
Feb 3, 2022, 1:30:20 PM2/3/22
to bo...@jvweb.fr, adwor...@googlegroups.com
Hi Boris,

GoogleAdsService.Search has a return_total_results_count field while SearchStream doesn't. The total row count gets returned on the first page of results. Our Report Streaming guide explains more. Feel free to get back to us.

Regards,

Google Logo
Aryeh Baker
Google Ads API Team
 


ref:_00D1U1174p._5004Q2W3wfO:ref

Boris DETRY

unread,
Feb 4, 2022, 4:44:22 AM2/4/22
to Google Ads API and AdWords API Forum
Yes, but not when I request for the summary of all rows only.

Google Ads API Forum Advisor

unread,
Feb 4, 2022, 11:57:41 AM2/4/22
to bo...@jvweb.fr, adwor...@googlegroups.com
Hi Boris,

GoogleAdsService.Search's return_total_results_count works well with SummaryRowSetting, I use both all the time and the total rows plus summary get returned in the first page. Feel free to get back to us.

Boris DETRY

unread,
Feb 4, 2022, 12:16:21 PM2/4/22
to Google Ads API and AdWords API Forum
Yes, my question is for "summary row only ".

I need to get millions of row that mach a filter just to count them. So it take mimutes.  

Google Ads API Forum Advisor

unread,
Feb 6, 2022, 9:54:33 PM2/6/22
to bo...@jvweb.fr, adwor...@googlegroups.com
Hi Boris,

Thank you for the reply.

Would you be able to illustrate to us the information that you want to get using the API report with sample values? I asked because the suggestion provided by my colleague is not satisfying your use case so it appears that you are looking for a specific set of information.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2W3wfO:ref

Boris DETRY

unread,
Feb 7, 2022, 3:51:09 AM2/7/22
to Google Ads API and AdWords API Forum
Hi,

Sure, I only want to count the number of "untreated search terms" or "added search terms".  For small accounts, there is no problem, I execute the query and then I count the results. But for bigger accounts (lets say an account with 2 or 3 million search terms) the request take too much time. 

So one of the solutions would be to request for "SUMMARY_ROW_ONLY" (docs here) but the value "total_results_count" is empty in this case.

Google Ads API Forum Advisor

unread,
Feb 7, 2022, 2:04:03 PM2/7/22
to bo...@jvweb.fr, adwor...@googlegroups.com
Hi Boris,

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

Could you please make small size and then it's almost the equivalent of summary row only. If you are still facing any issue, could you please provide us with the complete logs (request and response with request-id) via the Reply privately to the author option?

Thanks,
Google Logo
Nirmita Patel
Google Ads API Team
 


ref:_00D1U1174p._5004Q2W3wfO:ref

Boris DETRY

unread,
Feb 8, 2022, 9:57:27 AM2/8/22
to Google Ads API and AdWords API Forum
What do yo mean by "  small size  " ? The amount of data is not up to me. I need search terms for a period of one year for some accounts it's 15k search terms for others its 3 million. 

My initial question : Can  we have  "total_results_count" when SummaryRowSetting equal  "SUMMARY_ROW_ONLY" (so only summary row, not summary row with results)

Google Ads API Forum Advisor

unread,
Feb 8, 2022, 10:21:39 PM2/8/22
to bo...@jvweb.fr, adwor...@googlegroups.com
Hi Boris,

Thank you for your reply.

To confirm, we understand that you already tried in your Search request to include both the return_total_results_count and summary_row_setting = SUMMARY_ROW_ONLY, is this correct?

If yes, could you share to our team the generated request and response logs, with the request-id? I asked because as our colleague Aryeh mentioned earlier, he is able to acquire results. Our team would then refer to your logs and try to replicate it on our end so we can determine if there may be issues in your request when these settings are used together.

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.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2W3wfO:ref

Boris DETRY

unread,
Feb 11, 2022, 5:03:22 AM2/11/22
to Google Ads API and AdWords API Forum
Yes.

Thank you for your answer. 

Actually, I have trouble finding request ID because no exception is thrown.

But here is the request using C# library 

I dont it's a bug just the feature "count total rows" doesn't work with SummaryRowSetting = SummaryRowOnly


Capture.PNG

Capture.PNG
Capture.PNG

Google Ads API Forum Advisor

unread,
Feb 14, 2022, 12:14:57 AM2/14/22
to bo...@jvweb.fr, adwor...@googlegroups.com

Hi Boris,

Thanks for getting back to us.

Yes, you are correct. Return_total_results_count doesn't work when used with SummaryRowSetting equal  "SUMMARY_ROW_ONLY". However, it works when SummaryRowSetting equals “SUMMARY_ROW_WITH_RESULTS”. That said, I have created a feature request on your behalf to support with 'SUMMARY_ROW_ONLY'. Please note that this will be subject for review and for now, you may keep an eye on our blog for any update or announcements.

Let us know if you have any further questions.

Regards,

Google Logo
Yasar
Google Ads API Team
 

 

 



ref:_00D1U1174p._5004Q2W3wfO:ref

Boris DETRY

unread,
Feb 14, 2022, 3:38:34 AM2/14/22
to Google Ads API and AdWords API Forum
Thank you. 
Reply all
Reply to author
Forward
0 new messages