updated analytics code to allow demographics