packages/optimizely-sdk/lib/core/event_builder/index.js
function getVisitorSnapshot(configObj, eventKey, eventTags, logger) {
  var snapshot = {
    events: []
  };

  var eventDict = {
    entity_id: projectConfig.getEventId(configObj, eventKey),
    timestamp: fns.currentTimestamp(),
    uuid: fns.uuid(),
    key: eventKey,
  };

  if (eventTags) {
    var revenue = eventTagUtils.getRevenueValue(eventTags, logger);
    if (revenue !== null) {
      eventDict[enums.RESERVED_EVENT_KEYWORDS.REVENUE] = revenue;
    }

    var eventValue = eventTagUtils.getEventValue(eventTags, logger);
    if (eventValue !== null) {
      eventDict[enums.RESERVED_EVENT_KEYWORDS.VALUE] = eventValue;
    }

    eventDict['tags'] = eventTags;
  }
  snapshot.events.push(eventDict);

  return snapshot;
}
function getVisitorSnapshot(configObj, eventKey, eventTags, logger) {
  var snapshot = {
    events: []
  };

  var eventDict = {
    entity_id: projectConfig.getEventId(configObj, eventKey),
    timestamp: fns.currentTimestamp(),
    uuid: fns.uuid(),
    key: eventKey,
  };

  if (eventTags) {
    var revenue = eventTagUtils.getRevenueValue(eventTags, logger);
    if (revenue !== null) {
      eventDict[enums.RESERVED_EVENT_KEYWORDS.REVENUE] = revenue;
    }

    var eventValue = eventTagUtils.getEventValue(eventTags, logger);
    if (eventValue !== null) {
      eventDict[enums.RESERVED_EVENT_KEYWORDS.VALUE] = eventValue;
    }

    eventDict['tags'] = eventTags;
  }
  snapshot.events.push(eventDict);

  return snapshot;
}
function getVisitorSnapshot ( configObj , eventKey , eventTags , logger ) { var snapshot = { events : [ ] } ; var eventDict = { entity_id : projectConfig . getEventId ( configObj , eventKey ) , timestamp : fns . currentTimestamp ( ) , uuid : fns . uuid ( ) , key : eventKey , } ; if ( eventTags ) { var revenue = eventTagUtils . getRevenueValue ( eventTags , logger ) ; if ( revenue !== null ) { eventDict [ enums . RESERVED_EVENT_KEYWORDS . REVENUE ] = revenue ; } var eventValue = eventTagUtils . getEventValue ( eventTags , logger ) ; if ( eventValue !== null ) { eventDict [ enums . RESERVED_EVENT_KEYWORDS . VALUE ] = eventValue ; } eventDict [ 'tags' ] = eventTags ; } snapshot . events . push ( eventDict ) ; return snapshot ; }
Creates object of params specific to conversion events
@param  {Object} configObj                 Object representing project configuration
@param  {string} eventKey                  Event key representing the event which needs to be recorded
@param  {Object} eventTags                 Values associated with the event.
@param  {Object} logger                    Logger object
@return {Object}                           Conversion event params
Creates object of params specific to conversion events