Updated to check that analytics queue is defined before posting the event