AWQL错误/似乎无法检索任何数据

时间:2019-01-07 13:30:00

标签: c# asp.net-mvc google-adwords awql

我正在将我的网站挂接到AdWords API中。我似乎在从API请求所有类型的数据时遇到问题。

我收到的错误都是AWQL语法问题(例如Error in query: unexpected input DURING.

这是我的代码:

GoogleAdsClient adClient = new GoogleAdsClient();
adClient.Config.OAuth2ClientId = "...";
adClient.Config.OAuth2ClientSecret = "...”;
adClient.Config.OAuth2RefreshToken = "...”;
adClient.Config.DeveloperToken = “...”;

var googleService = adClient.GetService(Google.Ads.GoogleAds.Services.V0.GoogleAdsService);

string query = @"SELECT Impressions,Clicks,Ctr FROM KEYWORDS_PERFORMANCE_REPORT DURING LAST_7_DAYS";

PagedEnumerable<SearchGoogleAdsResponse, GoogleAdsRow> response =
                googleService.Search("MY_CUSTOMER_ID", query);

我相当确定AWQL没问题,所以我想知道这是否是我用来执行AWQL的服务的设置。有人可以在这里看到任何明显的东西吗?

1 个答案:

答案 0 :(得分:0)

您似乎正在使用GoogleAds API,而不是AdWords API。可以吗?

如果是这样,这里是migrate reports guide