For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
I am writing a custom web pixel for google tag manager in Checkout Extensions Web Pixel. There is a standard event called "checkout_shipping_info_submitted" which has shippingLine data (which can be accessed by event.data.checkout.shippingLine) from which I need to push the title of the shipping rate in event. However in description of this shippingLine object, it is saying that it will be transitioned to shipping_line object once user selects a shipping rate. But when testing in store, it is remaining the same and only price of the shipping rate selected by the user is accessible. How do I get the title of the shipping rate?
Unfortunately seems not to exists this information at this time.
Quite embarassing thinking that we have only 5 months left to the switchoff of the checkout.liquid customization
I solved it, you can get shipping title by -> event.data.checkout?.delivery?.selectedDeliveryOptions[0]?.title
https://changelog.shopify.com/posts/more-data-fields-available-in-web-pixels
It has been released at the beginning of the summer