Interesting. From your headline here I was hoping that you used the standard Google snippet with an override of the tracking host. I think it would be more powerful to save whatever the same GA setup would save.
Opening a new WebSocket for each client sounds like a lot of stress on the server, do you need the persistent connection? What if the client visits a new page? A new connection is created?