move code Analytic to main.js