function trackEvent(eventData, opts = {}, payload) {
  if (gaNotLoaded()) return
  const { instancePrefix } = getInstanceDetails(opts)
  const data = {
    // hitType https://bit.ly/2Jab9L1 one of 'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception', 'timing'
    hitType: eventData.hitType || 'event',
    // eventAction https://bit.ly/2CUzeoz
    eventAction: eventData.event,
    // eventLabel http://bit.ly/2oo8eb3
    eventLabel: eventData.label,
    // eventCategory http://bit.ly/2EAy9UP
    eventCategory: eventData.category || 'All',
    // nonInteraction https://bit.ly/2CUzeoz
    nonInteraction: (eventData.nonInteraction !== undefined) ? !!eventData.nonInteraction : false
  }

  if (eventData.value) {
    // how much is this action worth?
    data.eventValue = format(eventData.value)
  }

  /* Attach campaign data */
  const campaignData = addCampaignData(eventData)
  /* Set Dimensions or return them for payload is config.setCustomDimensionsToPage is false */
  const dimensions = setCustomDimensions(payload.properties, opts, instancePrefix)

  const finalPayload = {
    ...data,
    /* Attach campaign data, if exists */
    ...campaignData,
    /* Dimensions will only be included in the event if config.setCustomDimensionsToPage is false */
    ...dimensions
  }

  /* Send data to Google Analytics */
  ga(`${instancePrefix}send`, 'event', finalPayload)
  return finalPayload
}
Send event tracking to Google Analytics
@param  {object} eventData - GA event payload
@param  {string} [eventData.hitType = 'event'] - hitType https://bit.ly/2Jab9L1 one of 'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception', 'timing'
@param  {string} [eventData.event] - event Action https://bit.ly/2CUzeoz
@param  {string} [eventData.label] - event Label http://bit.ly/2oo8eb3
@param  {string} [eventData.category] - event Category http://bit.ly/2EAy9UP
@param  {string} [eventData.nonInteraction = false] - nonInteraction https://bit.ly/2CUzeoz
@return {object} sent data