我写了下面的代码。但它会返回START_DATE和END_DATE之间具有最多浏览量的文章。它可能包含早于START_DATE发布的文章。但是我不希望在START_DATE之前发表文章。我需要在START_DATE和END_DATE之间发表的,获得最多观看次数的文章。可以提供Google Analytics(分析)选项吗?
AnalyticsService as = new AnalyticsService(appName);
String token = credential.getAccessToken();
as.setAuthSubToken(token);
DataQuery query = new DataQuery(new URL(baseUrl));
query.setIds("ga:" + propfileID);
query.setDimensions("ga:pageTitle,ga:pagePath,ga:pagePathLevel1,ga:pagePathLevel2,ga:pagePathLevel3,ga:hostname");
query.setSegment("gaid::-11");
query.setMetrics("ga:pageviews");
query.setSort("-ga:pageviews");
query.setMaxResults(20);
query.setStartDate(GA_MOST_READ_START_DATE);
query.setEndDate(GA_MOST_READ_END_DATE);
URL url = query.getUrl();
LOG.info("===GoogleAnalyticsScheduler===query==URL: " + url.toString());
DataFeed feed = as.getFeed(url, DataFeed.class);