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:

Table of Contents Placeholder

How It Works

There are two components related to implementing currency conversion:

  • Tealium Currency Converter Tag
  • Currency Converter Extension (Learn more)

Tealium Currency Converter Tag

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.

Currency Converter Extension

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.

Adding the Tag

  1. Navigate to the Tag Marketplace and add the Tealium Currency Converter Tag.
  2. Using the Tag wizard, give the Tag a specific title, enter any notes, and proceed to the load rules tab.
  3. Select any load rules you wish to apply, then click Finish.Currency_Converter_Tag_-_Tag_Configuration.png

Currency Convert Function

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");