added js functionality back and advanced analytics