implemented analytics properly