简体   繁体   中英

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.

I using DateRange object to define startDate and 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'

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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