Skip to content
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
@nickrathwell

Description

@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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    migratedThe issue has been migrated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions