fixed url encoding issue in generator
added logging for analytics