move analytics to separate file.