Added modified analytics code