Help with querying click_view

180 views
Skip to first unread message

Daniela Macena

unread,
May 25, 2023, 12:05:15 AM5/25/23
to Google Ads API and AdWords API Forum
when I query the click_view table Im getting this error message: Request contains an invalid argument


 try
            {
                // Constructs the query.
              

                string query = @"
               SELECT
                    click_view.ad_group_ad, click_view.gclid
               FROM
                click_view  WHERE click_view.gclid = 'xxxxxxxxaTpppppppppppppppp";



             


                // Creates the search request.
                SearchGoogleAdsRequest searchRequest = new SearchGoogleAdsRequest()
                {
                    Query = query
                };

                // Issues the search request and gets the first result.
                //SearchGoogleAdsResponse searchResponse =
                  //  googleAdsClient.GetService<GoogleAdsServiceClient, GoogleAdsServiceSettings, GoogleAdsConfig>().Search(searchRequest);

                GoogleAdsServiceClient googleAdsService = googleAdsClient.GetService( Services.V12.GoogleAdsService);

                List<string> items = new List<string>();
                Task t = googleAdsService.SearchStreamAsync("111111", query,
                delegate (SearchGoogleAdsStreamResponse resp)
                {
                    foreach (GoogleAdsRow googleAdsRow in resp.Results)
                    {
                        Console.WriteLine(googleAdsRow);
                        //string item = googleAdsRow.ConversionAction.Id.ToString();
                        string item = $"{googleAdsRow.ConversionAction.Id} - {googleAdsRow.ConversionAction.Name} - {googleAdsRow.ConversionAction.Status}";
                        items.Add(item);
                    }
                }
                );
                await t;
                var x = items;

            

                Uploading(googleAdsClient);
            }
            catch (GoogleAdsException ex)
            {
                Console.WriteLine($"Failed to retrieve conversion action ID. {ex}");
            }

when I query this below code is working   //string query = $@"SELECT conversion_action.id, conversion_action.name
                //                  FROM conversion_action
                //                  WHERE conversion_action.status = 'ENABLED'
                //                  AND conversion_action.name='xxxxxxxMLinks' ";
could you please help me?
Many Thanks

Google Ads API Forum Advisor

unread,
May 26, 2023, 12:51:08 PM5/26/23
to daniela...@gmail.com, adwor...@googlegroups.com

Hello,

Thanks for reaching out to the Google Ads API Team.

Can you please provide us with the complete request and response logs with request ID generated on your end when you performed your API request so we can investigate further as to why you are encountering errors?

Please note that when 'click_view' is the resource in the FROM clause, a filtering condition must be present in the WHERE clause specifying a single day within the last 90 days. You may validate your queries using the Query Validator and build a query for click_view via the API documentation links below:

You can provide it via Reply privately to the author option. If this option is not available, then send it instead on this email address googleadsa...@google.com

This message is in relation to case "ref:_00D1U1174p._5004Q2lt7Ul:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages