Enhanced Link Attribution
// optimized http://mathiasbynens.be/notes/async-analytics-snippet#universal-analytics
(function(G,o,O,g,l){G.GoogleAnalyticsObject=O;G[O]||(G[O]=function(){(G[O].q=G[O].q||[]).push(arguments)});G[O].l=+new Date;g=o.createElement('script'),l=o.scripts[0];g.src='//www.google-analytics.com/analytics.js';l.parentNode.insertBefore(g,l)}(this,document,'ga'));
ga('create','UA-XXXXXXXX', 'auto');
// Enhanced Link Attribution:
// https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#enhancedlink
// https://support.google.com/analytics/answer/2558867?hl=en
ga('require', 'linkid', 'linkid.js');
// Support Display Advertising: https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad
ga('require', 'displayfeatures');
// Track special redirect url, if you set one
var url = $('#ga_track_r_url').val();
if (url && url != '') ga('send', 'pageview', url);
// Send usual page view
ga('send','pageview');