Hello @DeeH,
Welcome to the Klaviyo Community!
Both of those link formats should actually work in bringing your users back to their checkout page with a discount automatically applied. The difference though, is that the one provided in our How to Add a Link that Applies a Unique Coupon Code at Checkout for Shopify Help Center article is meant to bring checkout abandoners directly back to their checkout session - hence the storefront ID and checkout token variables used in the URL format.
In my experience, if this link breaks, it typically means that either the checkout session is no longer valid or you’ve added in some extra formatting without meaning to. Oftentimes a checkout session would not longer be valid if the checkout event you were previewing as was of a customer who had already completed their purchase. Since the session was technically completed, the link wouldn’t actually be functional as there wouldn’t be an available session to take the customer back to. Keep in mind that when previewing metric triggered flows with event data, you’re previewing the emails of the ten most recent events that triggered the metric - regardless of the overall outcome or future actions taken by your customers.
Another common mistake that I come across frequently - especially when it comes to dynamic variables - is copy and pasting additional formatting. When you’re copy and pasting data from one source to another, we highly recommend copying and pasting without formatting. You can paste something without formatting by Ctrl+Shift+V instead of Ctrl+V when pasting. If you’re using a Mac, you would use the Option+Shift+Command+V commands.
Also, don’t forget, that because you’re only previewing the email rather than sending it live, it’s expected behavior that the discount code wouldn’t work and proceeds with a PREVIEW messaging. My colleague @Dov, our champion @retention, and myself have explained in past Community posts:
I hope this helps! If you were able to find an alternative solution after working with our Support colleagues, it would be great if you shared that solution here as it may help other Community members who come across the same issue!
David