Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/tracking / src / amplitude / mapTrackingDataToAmplitude.js
Size: Mime:
/**
 * Mapper from an object created by getTrackingDataObject to an object compatible with Google Analytics tracker API
 *
 * @param {Object} trackingData - An object produced by getTrackingDataObject function
 * @return {undefined}
 */
const mapTrackingDataToAmplitude = ({ track }) => {
  const { type: eventType, ...eventProperties } = track.properties || {};
  const destinationData = {
    eventType,
    eventName: track.event,
    eventProperties,
  };

  return destinationData;
};

export { mapTrackingDataToAmplitude };