Can you provide a python example of this functionality? From what I can tell this does not exist in the Python client library. There is only a .search method on the GoogleAdsService which does accept a page_size argument, however the response is still a generator of the page of data. Let me know, thanks.
Thanks a lot, I appreciate that.
From: adwordsap...@google.com <adwordsap...@google.com>
Sent: Tuesday, February 12, 2019 8:01:13 AM
To: Philip Stefou
Cc: AdWords API and Google Ads API Forum
Subject: RE: Can a row count be obtained without iterating through all rowsHello Philip,
I have passed your suggestion to the team and I will update you once I have more information. Meanwhile, you could keep an eye on our blog for information related to the future releases.
Regards,
Sai Teja, Google Ads API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
On 02/11/19 16:30:28 pst...@wordstream.com wrote:
Thanks for the follow-up, unfortunately this will still involve pulling the result set over the network. We'll have to think of something else. Thanks.
From: adwordsap...@google.com <adwordsap...@google.com>
Sent: Tuesday, February 12, 2019 2:09:33 AM
To: Philip Stefou
Cc: AdWords API and Google Ads API Forum
Subject: RE: Can a row count be obtained without iterating through all rowsHello Philip,
It is the total number of elements in the response page. As a workaround you could remove the PAGE_SIZE in your request(don't set PAGE_SIZE), so that the entire result set will be in a single page and then the number of rows in the response will be equal to the number of elements in the page.
Code snippet in Java:
searchPagedResponse.getPage().getPageElementCount();
Please let me know if you have any further questions.
Regards,
Sai Teja, AdWords API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
On 02/08/19 16:07:18 pst...@wordstream.com wrote:
Thanks for the reply, does this give the row count of the total number of rows that would be returned by the query or just the rows on the page? The problem I'm trying to solve is obtaining a total count of all rows that would be returned by a given query, without the need to pull all the data over the network. Let me know what you think, thanks again.--
On Saturday, February 9, 2019 at 5:59:35 AM UTC+9, googleadsapi-forumadvisor wrote:Hello Phil,
To get the count of the rows without iterating you could use the below code code snippet for Java. You could use the similar functionality in other client libraries as well to get the count of the results. Also, the PAGE_SIZE attribute can be mentioned for the search query to get not more than that many results in the response. You could refer our sample code to get campaigns in Java here for reference, code samples in other languages can be found here.
Code snippet in Java:searchPagedResponse.getPage().getPageElementCount();
Please let me know if you have any further questions.
Regards,
Sai Teja, Google Ads API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/f195128e-b692-4922-aa51-3a8168ade889%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks Ben, we would be using this in a production environment so I would rather hold out for a more publicly documented solution just due to the fact that this could easily disappear without warning. I appreciate you having looked into it, please do let me know though if this functionality does become official. Thanks.
Hi Philip!
Thanks for reaching out with this question. I believe a COUNT-like function would need to be supported by GAQL and wouldn't necessarily be exposed via the client libraries. In Python the iterator object returned by search does have a num_results property, but I think it may only refer to the current page, and also seems to be 0 until the page is actually requested. It also looks like the Java sample mentioned in this thread must retrieve a response before it can retrieve num results.
I'll double-check whether there is a way to retrieve only row counts in GAQL, and will also see if there's something fancy that can be done with the GRPCIterator in Python. I'll get back to you as soon as possible once I get some more information.
Thanks,Ben, AdWords API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Thanks Ben, that sounds great. I'm excited to hear what you guys come up with! Just let me know when a decision has been reached. Thanks again.