Chord OMS
...
Developer Tools
Gatsby

Release Notes

26min

v6.0.3

This release adds two properties to the "Order Completed" Segment event: has_subscription and is_recurring. These properties already exist on the "Order Completed" event Segment event sent by the Chord OMS.

  • has_subscription is a boolean that indicates whether the order contains a subscription.
  • is_recurring is a boolean that indicates whether the order is a subscription installment order and will always be false, since subscription installment orders are not placed via the SDK.

v6.0.2

This release adds a url property to the Product type that is an optional or required argument you can pass to the following methods:

  • useAnalytics().trackCartViewed()
  • useAnalytics().trackProductClicked()
  • useAnalytics().trackProductViewed()
  • useAnalytics().trackVariantClicked()
  • useCart().addToCart()
  • useCart().removeFromCart()
  • useCheckout().finalizeCheckout()
  • useCheckout().prepareCheckout()
  • useProduct().createStockRequest()
  • useSubscription().cancelSubscription()
  • useSubscription().pauseSubscription()
  • useSubscription().resumeSubscription()
  • useSubscription().skipSubscription()

When the url property is given a value, the value will be sent as the url property in the resulting Segment event.

v6.0.1

This release restores the ability to send an ACS-Store header with all requests to the OMS. This is necessary for users operating storefronts with multiple stores. In order to use this, you must supply the storeSlug option in your gatsby-config.js like so:

JS


You can find the store's slug in your OMS (see figure below). Omitting this value will default all storefront operations to the default store.

How to find your store's slug
How to find your store's slug


v6.0.0

This release adds an “Order Completed” Segment event to the finalizeCheckout() method. Previously, finalizeCheckout() sent a “Checkout Completed” Segment event. Now, finalizeCheckout() sends both “Order Completed” and “Checkout Completed”.

No changes to your website code are required to upgrade to this release. However, we’re releasing this change as a new major version because the “Order Completed” event is a standard event that many Segment destinations process automatically, and adding it may impact the way your Segment destinations track conversions and revenue.

“Order Completed” is part of the Segment ecommerce event spec. It is usually mapped by default to standard conversion/purchase events in Segment destinations like the Facebook Pixel and TikTok Conversions destinations. You can override this mapping in the Segment destination settings. You may have changed the event mapping in your Segment destination settings to map “Checkout Completed” to the conversion/purchase event for the destination. This will continue to work.

The Chord OMS back-end Segment source has always sent an “Order Completed” event, and you may have connected Segment destinations to this source that are using this event to track conversions and revenue. We recommend continuing to rely on this “Order Completed” event, if possible, because events from back-end sources tend to be more reliable and accurate. (You can read more about this from Segment.)

If you currently have any Segment destinations connected to both the Chord OMS back-end Segment source (typically named "My Company Back-End (Production)”) and your website front-end Segment source (typically named "My Company Front-End (Production)”), you may want to add a destination filter to stop your destination from receiving “Order Completed” events from one of the two Chord Segment sources. If a destination receives an “Order Completed” event from both sources, that could result in revenue or conversions being double counted.

Note regarding the Google Universal Analytics Segment destination: This destination accepts total or revenue as a property on "Order Completed", but not both. The "Order Completed" event does include both of these properties, to match the Segment ecommerce spec and to be compatible with other Segment destinations. You may need to add a destination-specific transformation to remove one of the two properties.

v5.0.2

This release reverts a change made in v5.0.1 to the trackPage option of the segmentConfig configuration object. Prior to v5.0.1, page tracking was not optional and the trackPage option was ignored. In v5.0.1, passing trackPage: true would result in double pageviews. v5.0.2 reverts this change.

v5.0.1

This release fixes a bug where the manualLoad option in the segmentConfig configuration object was being ignored and always set to false. This meant that Segment tracking did not work if the site was not using Segment's Consent Manager or explicitly calling analytics.load("YOUR_WRITE_KEY"). If you are using the site without Segment's Consent Manager, you should initialize the site with the following keys in your gatsby-config.js:

JS


v5.0.0

This release refactors the Stytch integration works with this library. This is breaking change compared to v4.0.0 and requires you to redo how you initialize Stytch in this library, if you are using it. You can look at the document below to see how to use this library.

v4.1.2

This release updates the @chordcommerce/chord-magic dependency to v1.4.0 and the @chordcommerce/react-autonomy dependency to v1.2.0.

v4.1.1

This bugfix release addresses some bugs caused by our Stytch integration in non-Stytch setups introduced in v4.1.1.

v4.1.0

This release brings support for Stytch as an approved Chord authentication provider. Documentation on how to setup and use Stytch can be found here.

v4.0.0

This release is a significant refactor that updates @chordcommerce/gatsby-theme-autonomy to use Chord's React SDK for most functionality. Please see the v3.x to v4.x Migration Guide for instructions for upgrading.

Key highlights of this release include:

  • Typescript support
  • Removed dependency on CMS product catalog
  • JSDoc documentation
  • Improved hooks and methods

This release contains significant breaking changes, mostly around method names and arguments. We recommend reading the v3.x to v4.x Migration Guide before upgrading.

v3.0.0

This major release of this Gatsby theme moves Gatsby and all related Gatsby plugins and transformers from direct dependencies to peerDependencies so that consumers of this package can upgrade Gatsby without any intervention from Chord. This will require you to do more than just bump this version in the package.json.

First, edit your package.json to drop @chordcommerce/gatsby-theme-autonomy and any of the listed peerDependencies in the theme's peerDependencies from your dependencies block. We will be reinstalling them in the next section.

Then, you should run the following command in your shell:

Text


There is a chance that this command with fail with a very unhelpful error message. If that happens, the program will output an npm install/yarn add command that you can copy and run manually.

For more information and caveats around this, please read the installation instructions for this package.

v2.2.2

This release fixes an issue where incorrect routes were being rendered to the sitemap. Routes should be rendered to the sitemap without the localization, for example: https://example.com/products/t-shirt, however only routes with the en-US localization were being rendered, for example: https://example.com/en-US/products/t-shirt. It is recommended that you upgrade to this version and then re-crawl your site via the Google Search Console.

v2.1.0

This release adds modifyLineItem to the useCart hook providing more flexibility to modifying line items such as updating quantity and line item options. See here for accepted parameters.

v2.0.6

This release updates @chordcommerce/chord-magic to v1.1.1 is using the lates magic-sdk version 8.

v2.0.4

Fix one issue with Square Checkout's finalizeCheckout: the SDK was calling forgetOrder before the actual call to finalize the checkout using the API. This was producing requests without any auth token, because the current order token was already lost when the request is sent. On Stripe there is another auth mechanism and it works with or without that token. To fix the issue, on Square `forgetOrder is called only after a successful finalize.

v2.0.3

Added ACS-Anonymous-Id header to all requests to track the Segment AnonymousId server side. This is internal and will not impact customer development.

v2.0.2

Change the existing finalizeCheckout() so that it is compatible with the Square checkout. In fact, this is the last step of the Square Checkout, which allows finalizing the order and allows the user to start a new one, and unlike Stripe, it can be called without a checkout_session_id. This method has been made available via the useSquareCheckout hook, even if it does exactly the same as the one provided in the useCart hook.

v2.0.1

Adds a new step of the Square checkout, that allows entering payment information, called updateOrderPayment(). To work, it should pass along a token retrieved on the client-side using the Square Web Payments APIs.

v2.0.0

This release adds support for Gatsby 4! Please see the v1.2.7 to v2.0.0 Migration Guide for instructions for upgrading. There are no additional features, but be sure to check out release notes below if migrating from a version below v1.2.7.

Key highlights of this release:

Troubleshooting

See troubleshooting in the v1.2.7 to v2.0.0 Migration Guide for all troubleshooting related to upgrading.

Upgrading from a version below v1.2.7

Please read the release notes for previous releases to find out what changed, but important breaking changes to highlight include:

Segment Consent Manager (breaking change in )

See the change to the Segment Consent Manager in v1.2.0 release notes and ensure you have the segmentConfig set in gatsby-config.js.

Product Merchant feed (breaking change in )

This theme no longer provides a Merchant feed. See the change in v1.0.6 release notes and implement a feed in your website code.

Other Breaking Changes

AuthError and AuthErrorCodes no longer exported from @chordcommerce/gatsby-theme-autonomy

AuthError and AuthErrorCodes are no longer exported from @chordcommerce/gatsby-theme-autonomy. This is because they were directly related to the @chordcommerce/chord-magic package. If you are importing these, you will now have to update to import from @chordcommerce/chord-magic.

Before

JS


After

JS


v1.2.7

Fixes a bug where an expired user session continues to be retried instead of being cleared from the app state.

v1.2.6

Adds a new step of the Square checkout, this time to update the order's delivery options, with updateOrderDelivery() For now, it just works when a single delivery option is available, and it is only used to move the order to the payment state.

v1.2.5

This version fixes a bug where, when an order is completed, the completed order is still momentarily still available from the useCart hook. Now the order is cleared as soon as finalizeCheckout() is called. No changes to React components are required for this fix.

This version also includes a new forgetCart() method that can be used in similar situations if necessary.

v1.2.4

This version includes the first functions to start a checkout with Square. It is still experimental and we will release a new major version when the whole checkout flow will be available. This version only adds:

  • updateOrderAddresses() to update an existing order with a shipping address.
  • getStates() to retrieve the list of states in a specific country. Their ids will be used in the body of the request when updating an order's address.

v1.2.0

Key highlights of this release:

This release adds support to manually load our Segment plugin, in order to implement Segment's Consent Manager in our starters. It introduces a change in the way you would normally configure Segment in your theme. Please see below.

Starting from v1.2.0, it is now the responsibility of the starter to pass a proper Segment configuration to the theme, via the starter's gatsby-config.js file, as follow:

JS


Please read this to learn more details about those settings.

Note: manualLoad is an advanced feature. It is set to true by default in our Gatsby starters so that Segment's Consent Manager can work properly. Alternatively, you can use it if you are calling analytics.load({writeKey}) manually elsewhere in your code.

Use manualLoad false if you do not use, or have removed, the Consent Manager implementation (see below).

Consent Manager & Gatsby Autonomy Starter

Gatsby starter v2.3.0+ (Autonomy) ships with a new Consent Manager component. You can find it at: /src/components/Segment/ConsentManager/index.jsx.

This component is an analytics.js add-on with support for consent management. At its core, the Consent Manager empowers visitors to control and customize their tracking preferences on the website. They can opt out entirely of being tracked, or selectively opt out of tools in which they don’t want their information stored.

The Consent Manager banner is shown automatically for visitors from the EU. You can also decide to show it by default by configuring the GATSBY_SEGMENT_SHOULD_REQUIRE_CONSENT new environment variable to true in your .env file.

We have also integrated a way to manage your Consent Manager preferences from the Starter's footer component.

Integrations

In order for the Consent Manager to work, you must setup Segment integrations in your target Segment workspace.

You can verify that your integrations (Google Analytics, Amplitude, etc) are accessible for the Consent Manager component by visiting the URL below. It should not return an empty array if you have properly configured them.

Text


Troubleshooting

There is a known Gatsby issue that might occurred, where a blank page is rendered all over the site.

This issue only occurs if you build and serve the site (as opposed to simply yarn dev). When/if that happens, edit your /src/components/Segment/ConsentManager/index.jsx and move the {children} coming from the wrapRootElement before the <ConsentManager />

Rebuild and serve (yarn build && yarn serve), or use your Netlify/Gatsby Cloud review apps and verify the results.

v1.0.6

This release introduces a breaking change: the Product Merchant feed generator has been removed from this theme. It is now the responsibility of the website code to enable it. You can find an implementation example in the following pull request.

Updated 11 Jul 2023
Did this page help you?