简体   繁体   English

Google Analytics(分析)报告API v4:从两个日期之间精确到小时的日期范围内获取数据

[英]Google Analytics report api v4: get data from date range between two dates accurate to hours

I trying to get Google Analytics Report api v4 data from Java code. 我试图从Java代码获取Google Analytics(分析)Report API v4数据。

I using DateRange object to define startDate and endDate. 我使用DateRange对象定义startDate和endDate。

DateRange dateRange = new DateRange();
dateRange.setStartDate(startDate);
dateRange.setEndDate(endDate);

But The Start and End dates for the query in the format 'YYYY-MM-DD' 但是查询的开始日期和结束日期格式为“ YYYY-MM-DD”

Is there a way to to additionally specify a hours? 有没有办法额外指定一个小时?

Thanks! 谢谢!

No, the day starts at midnight of the view you are querying. 不,这一天从您要查询的视图的午夜开始。 However you can query for the hour of the day as a dimension (ga:hour for the hour of the day, or ga:dateHour for the date with the hour) and use that to filter in your results for the timeframe you want. 但是,您可以查询一天中的小时作为维度(ga:hour是一天中的小时,或ga:dateHour是带有小时的日期),然后使用该值来过滤所需时间范围内的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM