Added analytics tracking functionality