1
votes

I am looking for a way to get the most up to date possible sessions from Google Analytics.

The standard Google Analytics API as you are probably aware can be hours out of date. I had a look at the realtime dashboard and can't seem to find an rt:sessions/visits. rt:pageviews is close but doesn't give me quite what I need, has anyone found a combination of dimensions/metrics to get realtime sessions from the realtime api?

Thanks!

1

1 Answers

2
votes

Google analytics standard reports can take between 24 and 48 hours to complete processing the Google Analytics API (reporting v4 and core v3) are reading from the same data as the Google Analytics standards reports. If the data has not completed processing there is no way for you to get the data. The google analytics api v4 does have a new field in the response called isgolden which will tell you if the data you have requested is done processing or not.

isDataGolden boolean Indicates if response to this request is golden or not. Data is golden when the exact same request will not produce any new results if asked at a later point in time.

The Realtime api is very limited in the data that you can get. As you have already stated is a limited number of dimensions and metrics available (Session count is not available only active users). This is due to the fact that these are the ones that processing is not needed on so the data is available for the API to return you. There is also a limitation that I think the Realtime api only contains data over the last five minutes.

There is no other way of getting the data out any faster