packages/optimizely-sdk/lib/utils/event_tag_utils/index.js
function(eventTags, logger) {
    if (eventTags && eventTags.hasOwnProperty(REVENUE_EVENT_METRIC_NAME)) {
      var rawValue = eventTags[REVENUE_EVENT_METRIC_NAME];
      var parsedRevenueValue = parseInt(rawValue, 10);
      if (isNaN(parsedRevenueValue)) {
        logger.log(LOG_LEVEL.INFO, sprintf(LOG_MESSAGES.FAILED_TO_PARSE_REVENUE, MODULE_NAME, rawValue));
        return null;
      }
      logger.log(LOG_LEVEL.INFO, sprintf(LOG_MESSAGES.PARSED_REVENUE_VALUE, MODULE_NAME, parsedRevenueValue));
      return parsedRevenueValue;
    }
    return null;
  }
function(eventTags, logger) {
    if (eventTags && eventTags.hasOwnProperty(REVENUE_EVENT_METRIC_NAME)) {
      var rawValue = eventTags[REVENUE_EVENT_METRIC_NAME];
      var parsedRevenueValue = parseInt(rawValue, 10);
      if (isNaN(parsedRevenueValue)) {
        logger.log(LOG_LEVEL.INFO, sprintf(LOG_MESSAGES.FAILED_TO_PARSE_REVENUE, MODULE_NAME, rawValue));
        return null;
      }
      logger.log(LOG_LEVEL.INFO, sprintf(LOG_MESSAGES.PARSED_REVENUE_VALUE, MODULE_NAME, parsedRevenueValue));
      return parsedRevenueValue;
    }
    return null;
  }
function ( eventTags , logger ) { if ( eventTags && eventTags . hasOwnProperty ( REVENUE_EVENT_METRIC_NAME ) ) { var rawValue = eventTags [ REVENUE_EVENT_METRIC_NAME ] ; var parsedRevenueValue = parseInt ( rawValue , 10 ) ; if ( isNaN ( parsedRevenueValue ) ) { logger . log ( LOG_LEVEL . INFO , sprintf ( LOG_MESSAGES . FAILED_TO_PARSE_REVENUE , MODULE_NAME , rawValue ) ) ; return null ; } logger . log ( LOG_LEVEL . INFO , sprintf ( LOG_MESSAGES . PARSED_REVENUE_VALUE , MODULE_NAME , parsedRevenueValue ) ) ; return parsedRevenueValue ; } return null ; }
Grab the revenue value from the event tags. "revenue" is a reserved keyword.
@param {Object} eventTags
@param {Object} logger
@return {Integer|null}
Grab the revenue value from the event tags . revenue is a reserved keyword .