Analytics java

Should not be merged now, but changes in the api were needed in master.