googleads / googleads-dotnet-lib

Google Ad Manager SOAP API .NET client library
Apache License 2.0
109 stars 199 forks source link

No Exception thrown, and no logging on AWQL query with Error on v10 #244

Closed Zweitze closed 2 years ago

Zweitze commented 2 years ago

I am using Google.Ads.GoogleAds 11.0.0.0 When executing this code:

                string Query = string.Format(@"
SELECT
    campaign.id, campaign.name, campaign.serving_status, campaign.start_date,
    ad_group.id, ad_group.name,
    ad_group_criterion.criterion_id, user_list.name,
    ad_group_criterion.final_urls, ad_group_criterion.final_mobile_urls
FROM ad_group_audience_view
WHERE
    campaign.status = 'ENABLED' AND
    campaign.serving_status IN ('SERVING', 'PENDING') AND
    campaign.start_date < '{0:yyyyMMdd}' AND
    ad_group.status = 'ENABLED' AND
    ad_group_criterion.status = 'ENABLED' AND
    ad_group_criterion.approval_status != 'DISAPPROVED'
",
                    DateTime.Today.AddDays(7d));

                GoogleAdsServiceClient gas = gaclient.GetService(
                    Services.V10.GoogleAdsService);
                gas.SearchStream(CustomerId.ToString(), Query,
                    delegate (SearchGoogleAdsStreamResponse resp)
                {
                    Console.WriteLine("RequestId: \"{0}\"", resp.RequestId);
                });

You will notice that resp.RequestId is an empty string, and the request and response are not logged. Note the query contains an error - remove the line "ad_group_criterion.status = 'ENABLED' AND" and everything is alright. This is probably an error in the API, as the query validator thinks the query is alright.

If you change the code to use V9 you will get an exception with error "InvalidArgument", but no information which argument is invalid. But in V10 the delegate is called with a nearly empty response, and the request and its response are not logged.

Note: the API error is a different issue, see https://groups.google.com/g/adwords-api/c/a2Kbod3J-uQ

Zweitze commented 2 years ago

This issue was intended for the Google Ads API library, not this one. Created new issue in https://github.com/googleads/google-ads-dotnet/issues/359