klongdesigns
8/28/2014 - 7:52 PM

Google Analytics event tracking code for WordPress

Google Analytics event tracking code for WordPress

function sendToGA(pagename,section) {
ga('send', {
  'hitType': 'event',          // Required.
  'eventCategory': 'footerLink',   // Required.
  'eventAction': 'click',      // Required.
  'eventLabel': 'Footer Link: ' + section,
  'eventValue': 4,
  'page':'/'+pagename,
});
}