You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, there doesn't seem to be a way to take advantage of that new fixed size with the current .net implimentation since there is only one ReadPage(int pageSize) method, suggesting that you must set a page size. (A page size of 0 yields no rows).
The text was updated successfully, but these errors were encountered:
You don't need to use the ReadPage(int pageSize) method, you can iterate or enumerate on the PagedEnumerable<SearchGoogleAdsResponse, GoogleAdsRow> object returned by Search.
Yeah anything really to dig the pit-of-success. As long as ReadPage is a method it is a distraction from the 'right' ways to do things and there's a disconnect between the api and this library. I understood that setting the page size was no longer supported from the api messaging, but the updated docs make it clear that paging IS still supported, just with fixed 10k pages. Even adding support info to the exception the case of this particular error would be fine - I'd take a runtime error that is specific to the library vs a generic one that points back to the api.
To be fair, before this issue I knew nothing about the api or the library but we new v16 support ends in 2025. My intent was to jump in to the code and just update those version numbers as I've done before but then ran into this error, thus diving down this rabbit hole. I think the streaming option is cleaner anyway, but i could have been pushed in that direction much faster with an obsolete tag or library specific exception message.
V17/V18 throws 'PAGE_SIZE_NOT_SUPPORTED' even when the field/param is set to default
Steps to Reproduce:
Linqpad script using 21.1.1 Google.Ads nuget:
`void Main()
{
GoogleAdsServiceClient _googleAdServiceClient;
}
`
Expected behavior:
PageSize not set in output with at least ONE "magic" page size, allowing for use of the latest V17/V18 api
Client library version and API version:
Client library version:21.1.1
Google Ads API version:17 and 18
.NET version:
.net 8
Request/Response Logs:
Nothing is logged when setting ReadPage(0). When pageSize into ReadPage is given, you can see it in the request:
GoogleAds.DetailedRequestLogs Information: 1 : [2024-12-04 17:54:08Z] -
---------------BEGIN API CALL---------------
Request
Method Name: /google.ads.googleads.v17.services.GoogleAdsService/Search
Host:
Headers: {
"x-goog-api-client": "gl-dotnet/3.1.0 gapic/21.1.1 gax/4.8.0 grpc/2.60.0 gccl/4.0.3 pb/3.25.0",
"developer-token": "REDACTED",
"login-customer-id": "1234665825",
"x-goog-request-params": "customer_id=2305300261"
}
{ "customerId": "2305300261", "query": "SELECT\r\n\t\tcampaign.id,\r\n\t\tcampaign.name,\r\n\t\tcampaign.status,\r\n\t\tmetrics.average_cpc,\r\n\t\tmetrics.average_cpm,\r\n\t\tmetrics.average_cost,\r\n\t\tmetrics.clicks,\r\n\t\tmetrics.impressions,\r\n\t\tsegments.date,\r\n\t\tad_group.id,\r\n\t\tad_group.name\r\n\t\tFROM ad_group WHERE campaign.status != 'REMOVED' AND segments.date \u003e= '2024-11-01' AND segments.date \u003c= '2024-12-03'", "pageSize": 10 }
Response
Headers: {
"request-id": "HdZbTjBpWqp8W46HU5NYSQ",
"date": "Wed, 04 Dec 2024 17:54:08 GMT",
"alt-svc": "h3=":443"; ma=2592000,h3-29=":443"; ma=2592000",
"google.ads.googleads.v17.errors.googleadsfailure-bin": "CmkKAggoEmNTZXR0aW5nIHRoZSBwYWdlIHNpemUgaXMgbm90IHN1cHBvcnRlZC4gU2VhcmNoIFJlc3BvbnNlcyB3aWxsIGhhdmUgZml4ZWQgcGFnZSBzaXplIG9mICcxMDAwMCcgcm93cy4SFkhkWmJUakJwV3FwOFc0NkhVNU5ZU1E=",
"grpc-status-details-bin": "CAMSJVJlcXVlc3QgY29udGFpbnMgYW4gaW52YWxpZCBhcmd1bWVudC4azAEKRHR5cGUuZ29vZ2xlYXBpcy5jb20vZ29vZ2xlLmFkcy5nb29nbGVhZHMudjE3LmVycm9ycy5Hb29nbGVBZHNGYWlsdXJlEoMBCmkKAggoEmNTZXR0aW5nIHRoZSBwYWdlIHNpemUgaXMgbm90IHN1cHBvcnRlZC4gU2VhcmNoIFJlc3BvbnNlcyB3aWxsIGhhdmUgZml4ZWQgcGFnZSBzaXplIG9mICcxMDAwMCcgcm93cy4SFkhkWmJUakJwV3FwOFc0NkhVNU5ZU1E="
}
Fault: {
"StatusCode": 3,
"Details": "Request contains an invalid argument.",
"RequestId": "HdZbTjBpWqp8W46HU5NYSQ",
"Failure": {
"errors": [
{
"errorCode": {
"requestError": "PAGE_SIZE_NOT_SUPPORTED"
},
"message": "Setting the page size is not supported. Search Responses will have fixed page size of '10000' rows."
}
],
"requestId": "HdZbTjBpWqp8W46HU5NYSQ"
}
}
----------------END API CALL----------------
Anything else we should know about your project / environment
I don't care what the page size is and I'm aware that as of V17 it is a fixed 10k:
https://ads-developers.googleblog.com/2024/06/announcing-v17-of-google-ads-api.html
However, there doesn't seem to be a way to take advantage of that new fixed size with the current .net implimentation since there is only one ReadPage(int pageSize) method, suggesting that you must set a page size. (A page size of 0 yields no rows).
The text was updated successfully, but these errors were encountered: