Analytics
6.3K members online now
6.3K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

How to get last minute data for given dimensions and metrics for current day using Java API

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello,

 

I am new to Google Analytics and have a requirement to pull data from GA in regular interval.  I have used core Java to get data but when applying filters to for current hour and last minute, not retrieving any data.  I was able to get only last hour data.  This what I have been using to pull data:

 

prifileId = "ga:xxxxxx" -  viewId

startDate = "2016-10-18"

endDate = "2016-10-18"

metrics= "ga:sessions,ga:users"

dims="ga:dimension5,ga:city,ga:browser,ga:date,ga:hour,ga:minute"

fltrs="ga:hour==02;ga:minute=10" 

 

GaData result = googleAnalytics.data().ga().get(profileId, startDate, endDate, metrics).setDimensions(dims).setFilters(fltrs);

 

Also, how to reference java API?

 

Any help is appreciated

 

Thank you

Vasa

1 Expert replyverified_user

How to get last minute data for given dimensions and metrics for current day using Java API

Rising Star
# 2
Rising Star

Try adding a more exact time stamp to your GA data. Instructions here: https://www.simoahava.com/analytics/improve-data-collection-with-four-custom-dimensions/

John Wedderburn, Advertiser Community, Rising Star
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.