Fixing analytics code