static metricToGA(metric) {
    let eventCat = { eventCategory: 'mz' };

    // https://developers.google.com/analytics/devguides/collection/analyticsjs/events
    // hitType must be one of 'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception', 'timing'.
    switch (metric.metric_name) {
      case 'new_user_activated':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, { eventAction: 'new_user_activated' })
        };
      case 'interaction_event':
        return this.interactionCases(metric, eventCat);
      case 'content_started':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, {
            eventAction: 'content_started',
            eventLabel: metric.content_id
          })
        };
      case 'content_consumed':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, {
            eventAction: 'content_consumed',
            eventLabel: metric.duration
          })
        };
      case 'user_session_updated':
        return {
          hitType: 'pageview',
          data: Object.assign(eventCat, { sessionControl: 'start' })
        };
      case 'content_session_updated':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, {
            eventAction: 'content_session_updated'
          })
        };
      case 'video_started':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, {
            eventAction: 'video_started',
            eventLabel: metric.referring_content_id
          })
        };
      case 'video_consumed':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, {
            eventAction: 'video_consumed',
            eventLabel: `${metric.percent_complete}%`
          })
        };
      case 'user_profile_updated':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, { eventAction: 'user_profile_updated' })
        };
      case 'external_link_clicked':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, {
            eventAction: 'external_link_clicked',
            transport: 'beacon'
          })
        };
      default:
        return;
    }
  }
/**
   * metric from zumobi's Metrics-0.9 is passed here and prepairs it for Google Analytics
   *
   * @param {obj} metric - metrics passed in from the event
   * @returns {obj} - objects that were passed as an event would be, expected input:
   */
metric from zumobi's Metrics-0.9 is passed here and prepairs it for Google Analytics
@param {obj} metric - metrics passed in from the event
@returns {obj} - objects that were passed as an event would be, expected input.
metric from zumobi ' s Metrics - 0 . 9 is passed here and prepairs it for Google Analytics @param { obj } metric - metrics passed in from the event @returns { obj } - objects that were passed as an event would be expected input .
static metricToGA(metric) {
    let eventCat = { eventCategory: 'mz' };
    switch (metric.metric_name) {
      case 'new_user_activated':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, { eventAction: 'new_user_activated' })
        };
      case 'interaction_event':
        return this.interactionCases(metric, eventCat);
      case 'content_started':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, {
            eventAction: 'content_started',
            eventLabel: metric.content_id
          })
        };
      case 'content_consumed':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, {
            eventAction: 'content_consumed',
            eventLabel: metric.duration
          })
        };
      case 'user_session_updated':
        return {
          hitType: 'pageview',
          data: Object.assign(eventCat, { sessionControl: 'start' })
        };
      case 'content_session_updated':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, {
            eventAction: 'content_session_updated'
          })
        };
      case 'video_started':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, {
            eventAction: 'video_started',
            eventLabel: metric.referring_content_id
          })
        };
      case 'video_consumed':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, {
            eventAction: 'video_consumed',
            eventLabel: `${metric.percent_complete}%`
          })
        };
      case 'user_profile_updated':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, { eventAction: 'user_profile_updated' })
        };
      case 'external_link_clicked':
        return {
          hitType: 'event',
          data: Object.assign(eventCat, {
            eventAction: 'external_link_clicked',
            transport: 'beacon'
          })
        };
      default:
        return;
    }
  }
static metricToGA ( metric ) { let eventCat = { eventCategory : 'mz' } ; switch ( metric . metric_name ) { case 'new_user_activated' : return { hitType : 'event' , data : Object . assign ( eventCat , { eventAction : 'new_user_activated' } ) } ; case 'interaction_event' : return this . interactionCases ( metric , eventCat ) ; case 'content_started' : return { hitType : 'event' , data : Object . assign ( eventCat , { eventAction : 'content_started' , eventLabel : metric . content_id } ) } ; case 'content_consumed' : return { hitType : 'event' , data : Object . assign ( eventCat , { eventAction : 'content_consumed' , eventLabel : metric . duration } ) } ; case 'user_session_updated' : return { hitType : 'pageview' , data : Object . assign ( eventCat , { sessionControl : 'start' } ) } ; case 'content_session_updated' : return { hitType : 'event' , data : Object . assign ( eventCat , { eventAction : 'content_session_updated' } ) } ; case 'video_started' : return { hitType : 'event' , data : Object . assign ( eventCat , { eventAction : 'video_started' , eventLabel : metric . referring_content_id } ) } ; case 'video_consumed' : return { hitType : 'event' , data : Object . assign ( eventCat , { eventAction : 'video_consumed' , eventLabel : ` ${ metric . percent_complete } ` } ) } ; case 'user_profile_updated' : return { hitType : 'event' , data : Object . assign ( eventCat , { eventAction : 'user_profile_updated' } ) } ; case 'external_link_clicked' : return { hitType : 'event' , data : Object . assign ( eventCat , { eventAction : 'external_link_clicked' , transport : 'beacon' } ) } ; default : return ; } }
metric from zumobi's Metrics-0.9 is passed here and prepairs it for Google Analytics
 @param {obj} metric - metrics passed in from the event
 @returns {obj} - objects that were passed as an event would be, expected input:
metric from zumobi ' s Metrics - 0 . 9 is passed here and prepairs it for Google Analytics @param { obj } metric - metrics passed in from the event @returns { obj } - objects that were passed as an event would be expected input :
// https://developers.google.com/analytics/devguides/collection/analyticsjs/events // hitType must be one of 'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception', 'timing'.