ported analytics service from share