Fix analytics triggering js code