Comments (3)
What's the use case? The problem with exposing the current step is it breaks for one page checkout & Shop pay where there are no concrete steps.
FWIW, you can retrieve the step on multi-page checkout within the web-pixel via url parsing:
// Step 1. Add and initialize your third-party JavaScript pixel (make sure to exclude HTML)
const steps = {
information: "information",
shipping: "shipping",
payment: "payment"
};
// Step 2. Subscribe to customer events using the analytics.subscribe() API
analytics.subscribe("page_viewed", event => {
const pathnameComponents = event?.context?.document?.location?.pathname?.split("/");
const step = pathnameComponents?.length >= 4 ? pathnameComponents[4] : null;
console.log(step);
// pixel("track", "event_name", event.data);
});
from ui-extensions.
@gil-- Thank you for your response. The use case is to publish the steps data to web pixel to track the steps. Unfortunately, we pixel does not provide any data regarding the checkout steps. I can get the step name with URL in the web pixel however, it will only contain page data like URL. It will not contain any cart line or customer data.
from ui-extensions.
The activeStep
is now available on 2024-04 https://shopify.dev/docs/api/checkout-ui-extensions/2024-04/apis/buyer-journey#useBuyerJourneyActiveStep - it currently only returns steps for the pre-purchase part of checkout (does not include post-purchase, order summary)
I'll keep this ticket open for now, but do let us know if there is a pressing need for extending this functionality to the steps after checkout
from ui-extensions.
Related Issues (20)
- Checkout extensions Stepper manual input validation in real-time
- [Checkout UI - React] Can't use Switch component on customer-account surface HOT 3
- POS UI Extensions Cart lineItems have stopped being returned correctly (possibly as of 9.16.0) HOT 3
- API to identify which App Blocks are (or aren't) installed
- Colored labels in POS UI Extension lists
- [Checkout UI React] Shipping methods are re-selected when adding or removing cart lines HOT 1
- Remove customValidator from FormattedTextField starting from version 2025-01
- POS UI extensions seriously broken in the latest iOS Shopify POS version HOT 24
- `useStorage` inconsistency between live and test stores in `@shopify/ui-extensions-react/checkout` HOT 1
- useSelectedPaymentOptions Payment method name (as available in script editor and payment functions)
- Map component incorrect zoom behaviour HOT 4
- Admin resourcePicker `multiple` option doesn't work if `variants` filter is set to false
- Payment Options sample code is in opposite order to API definitions
- POS UI Extensions - allow multiple sequential api.cart actions without surfacing red error banner HOT 2
- Checkout UI, Customer Account UI, Link component open confirmation alert in editor
- Add ability to add a fee to checkout without using a product
- Feature Request: Add Customer Tags to `useCustomer` Hook in Checkout UI API
- `ConsentPhoneField` props not working as documented
- Featured Request: Add order status (fulfilled or not) to Order Api (customer-account-ui)
- customer-account: ImageGroup extra blank space
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ui-extensions.