1
votes

When using the Google Core Reporting API v4 you can query day-by-day by using the API. Now I would like to query on hourly basis instead of daily basis to go one level "deeper" in case sampling occurs.

Now I know this could be done by adding the dimension DateTime but, this leaves me with one dimension slot that I can't use anymore. This is a problem since this is limited to 7. Also if I think about it, adding the ga:hour dimensions might give me more results since it's creating the same report with more detail in it. It does not get the data "for one hour".

I know it is possible to get hourly data when using the Google UI.The question is clear: how do I get hourly data from the Google Core Reporting API v4 (yyyy-MM-dd-HH)?

2

2 Answers

3
votes

You can't. You can only query a whole day of data, and then you can nuse a filter to only see one slice of data, but as you said that will use a dimension on your query and will not improve sampling at all.

0
votes

The R package googleAnalyticsR has the functionality for hourly anti-sampling.

So it must be possible. I assume that it uses filters to select specific hours of a day, since the package does not support using Google Analytics filters when hourly anti-sampling is required.

So to get your results for a specific hour, you can try including a filter using ga:dateHour