Check this space.
label = url.replace( 'https://', '' ).replace( 'http://', '' ).replace( 'www.', '' ); // Strip protocal. label = label.split('?')[0]; // Strip query string. //console.log( 'GA label: '+ label ); //var name = jQuery( this ).attr('name'); ga( 'send', 'event', { eventCategory: category, eventAction: action, eventLabel: label, transport: 'beacon', hitCallback: function() { document.location = url; } }); }); });