Repository URL to install this package:
|
Version:
1.0.0-alpha.7 ▾
|
/**
* 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 };