This repository was archived by the owner on Aug 14, 2019. It is now read-only.
This repository was archived by the owner on Aug 14, 2019. It is now read-only.
Google Analytics Integration extractCheckoutOptions bug, Impact Checkout Step Viewed and Completed #36
Open
Description
Base on the documentation:
https://segment.com/docs/spec/ecommerce/v2/#checkout-step-viewed
https://segment.com/docs/spec/ecommerce/v2/#checkout-step-completed
The checkout options are to be returned in this format:
analytics.track('Checkout Step Completed', {
checkout_id: '50314b8e9bcf000000000000',
step: 2,
shipping_method: 'Fedex',
payment_method: 'Visa'
});
However the Google Analytics Integration is coded to look for these value in that format
analytics.track('Checkout Step Completed', {
checkout_id: '50314b8e9bcf000000000000',
step: 2,
shipping_method: 'Fedex',
payment_method: 'Visa'
});
function extractCheckoutOptions(props) {
var options = [
props.paymentMethod,
props.shippingMethod
];
// Remove all nulls, and join with commas.
var valid = reject(options);
return valid.length > 0 ? valid.join(', ') : null;
}