- TLC Home Home
- Discussions & Ideas Discussions & Ideas
- Product Guides Product Guides
- Knowledge Base Knowledge Base
- Developer Docs Developer Docs
- Education Education
- Blog TLC Blog
- Support Desk Support Desk
The currency exchange rates from Open Exchange Rates are made available to your tag configuration via the Tealium Currency Converter Tag. Once installed you can convert monetary amounts between currencies. This tag is used in conjunction with the Currency Converter Extension.
In this article:
There are two components related to implementing currency conversion:
Once per day, the exchange rates from Open Exchange Rates are synced to the Tealium mCDN. When the Currency Converter Tag runs on your site, it fetches the exchange rate information from the file on the mCDN and makes it available to the extension. It also defines a utility JavaScript function so that you can perform conversions manually in your code.
The currency exchange rates are stored in this file:
https://tags.tiqcdn.com/utag/tiqapp/utag.currency.js
This is a blocking tag so, while it is still loaded asynchronously, it will prevent other Tealium tags from loading until it is loaded.
This extension makes it easy to configure the currency conversion to store a converted value in a data layer variable. Learn more about the Currency Converter extension.
When the Currency Converter tag is loaded on the page, the following utility function is available for use:
tealiumiq_currency.convert(amount, source_currency, converted_currency)
Parameter | Description |
---|---|
amount | The currency amount to convert, either as a string/number or an array of values. eg. 100 or [100, 200, 300] |
source_currency | The three-character currency code representing the value in amount. eg. "USD" |
converted_currency | The three-character currency code to convert the amount to. eg. "GBP" |
Example:
var order_total_uk = tealiumiq_currency.convert(100, "USD", "GBP");
Copyright All Rights Reserved © 2008-2021