added analytics to sockets