rolled my own analytics code