函数式编程
谢谢 DaImTo 下面的代码可以得到我想要的分析结果,希望可以帮到别人我使用Google Analytics API Symfony Bundle //Get daily views for the past week $pageView = $analyticsService->getDataDateRangeMetricsDimensions($viewId, '7daysAgo', 'today', ['pageviews'], ['date']); //Get page views every hour of the day $pageView = $analyticsService->getDataDateRangeMetricsDimensions($viewId, 'today', 'today', ['pageviews'], ['hour']);