modified event tracking code to be up to date with analytics.js