Google suggests this to track outbound links:
ga('send', 'event', 'outbound', 'click', url, {
'hitCallback': function () {
document.location = url;
}
});
It uses "hitCallback" to redirect the user to page once the event has been successfully tracked.
What is the syntax for tracking multiple events per click?
I'd prefer not to write code like this:
ga('send', 'event', 'outbound', 'click', url, {
'hitCallback': function () {
ga('send', 'event', 'foo', 'click', url, {
'hitCallback': function () {
ga('send', 'event', 'bar', 'click', url, {
'hitCallback': function () {
document.location = url;
}
});
}
});
}
});
Any solution needs to support IE7+ and have no library dependencies.