original analytics code