Replace old analytics code