Giter Site home page Giter Site logo

Comments (3)

gil-- avatar gil-- commented on September 6, 2024 1

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.

mt-analyzify avatar mt-analyzify commented on September 6, 2024

@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.

jun-shop avatar jun-shop commented on September 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.