added analytics code for #308