Fixed analytics implementation