Access the currency of liquid order object

Topic summary

A developer needs to access the currency code for a liquid order object on a confirmation page to support multi-currency conversion tracking. The challenge is that order amounts display in presentation currency rather than shop currency.

Proposed Solutions:

  • Using {{ order.total_price | money_with_currency | slice: -3, 3 }} to extract the ISO currency code from formatted price strings
  • However, this approach is fragile and depends on default Currency Formats being unchanged

Recommended Solution:

  • Use {{ checkout.currency }} to directly retrieve the currency code (e.g., GBP, USD, EUR)
  • This works because after purchase, the order becomes a checkout object
  • Important distinction: Use {{ checkout.currency }} not {{ shop.currency }} when selling in multiple currencies, as the latter only returns the shop’s base currency

Key Takeaway:
Many developers mistakenly use {{ shop.currency }} for multi-currency tracking when {{ checkout.currency }} is the correct approach for capturing the actual transaction currency.

Summarized with AI on November 17. AI used: claude-sonnet-4-5-20250929.

For multi-currency support in a generic conversion tracking pixel, how can I access the currency of an order on the confirmation page?

Since all monetary amounts in the order object are displayed in the presentation currency rather than the shop currency, I need to know the currency for a given order.

This seems like it would work to pull the currency ISO code if a store has not changed the default Currency Formats (and perhaps some do not list the code at the end), so is there a more robust solution?

{{ order.total_price | money_with_currency | slice: -3, 3 }}

Unfortunately it does not seem that cart.currency is available on the confirmation page.

2 Likes

Thank you for this post. Have you tried your suggestion:

‘currency’: ‘{{ order.total_price | money_with_currency | slice: -3, 3 }}’,

Did it work?

{{ checkout.currency }} is what you need to get currency code
that will return e.g. GBP / USD / EUR etc
(once the user has made a purchase it becomes a checkout and so you use the checkout object - cart doesn’t exist)

it’s quite amazing how common we see people tracking only using {{shop.currency }} when selling in multicurrency and not {{ checkout.currency }}