Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[google-analytics] Google Analytics Integration extractCheckoutOptions bug, Impact Checkout Step Viewed and Completed #183

Open
SegmentDestinationsBot opened this issue Aug 13, 2019 · 0 comments

Comments

@SegmentDestinationsBot
Copy link
Contributor

Migrated from #36 by @nickrathwell

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'
});

See code https://github.com/segment-integrations/analytics.js-integration-google-analytics/blob/master/lib/index.js#L903

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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant