Fix js code in analytics