Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search Stream request filters don't throw error if more than 20 000 items in IN clause. #342

Closed
bdetry opened this issue Jan 27, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@bdetry
Copy link

bdetry commented Jan 27, 2022

Google Ads API documentation says that the limit for filtering using GAQL query system it's 20 000 items in the IN clause and should return error FILTER_HAS_TOO_MANY_VALUES if the limit is exceeded. As you can see here.

In my case, I'm using a NOT_IN clause with more than 20 000 items in filter and no error is returned. It looks like instead of returning FILTER_HAS_TOO_MANY_VALUES it take the first 20k items of the filter and ignore the rest because I'm missing data. Actually, when I do the filter "manually" (with a loop in my code) I have all the results.

Here is the demonstration :

`var searchTerms = service.GetSearchTerms(request).ToList();

        var forFilterTest = searchTerms.Concat(searchTerms).Select(x => x.SearchTermView.ResourceName);

        var requestTest = new SearchTermRequest(452********, new TimeRange(DateTime.Now.AddMonths(-11) , DateTime.Now.AddMonths(-1)))
        {
            Fields = new List<string>()
            {
                "campaign.name",
                "ad_group.name",
                "metrics.cost_micros",
                "metrics.clicks",
                "metrics.impressions",
                "metrics.conversions",
                "metrics.cost_per_conversion",
                "metrics.conversions_value",
                "search_term_view.status",
                "search_term_view.search_term",
                "search_term_view.status",
                "segments.search_term_match_type",
                "ad_group.name",
                "campaign.advertising_channel_type",
                "search_term_view.search_term",
                "metrics.cost_per_conversion",
                "metrics.top_impression_percentage",
                "metrics.average_cpc"
            },
            Filters = new List<Filter>()
            {
                new Filter("search_term_view.resource_name" , Condition.NOT_IN, forFilterTest)
            }
        };`
@bdetry bdetry added the bug Something isn't working label Jan 27, 2022
@bdetry bdetry closed this as completed Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant