Skip to main content

Currency conversion enrichment

Don't use this enrichment

We recommend managing currency conversion downstream instead of using this enrichment. For example, you could bring currency exchange rate information into your data warehouse and join that data with your Snowplow data.

This legacy enrichment uses Open Exchange Rates to convert the currencies used in transactions. It requires an Open Exchange Rates account and API key.

This enrichment only works with the legacy tr_ and ti_ ecommerce atomic event fields. Also, it can only use the exchange rate from the end of the day prior to the event's collector_tstamp. For these reasons, we recommend handling currency conversion downstream instead of using this enrichment.

Configuration

The enrichment takes these parameters:

ParameterRequiredDescription
apiKeyOpen Exchange Rates API key.
baseCurrencyCurrency to convert all transaction values to.
rateAtDetermines which exchange rate will be used. Only EOD_PRIOR is supported, meaning that the enrichment uses the exchange rate from the end of the day prior to the event's collector_tstamp.
accountTypeLevel of Open Exchange Rates account. Must be DEVELOPER, ENTERPRISE, or UNLIMITED.

Configure the parameters in the Console enrichment editor. For example:

json
{
"accountType": "DEVELOPER",
"apiKey": "{{KEY}}",
"baseCurrency": "USD",
"rateAt": "EOD_PRIOR"
}
Testing with Micro

Unsure if your enrichment configuration is correct or works as expected? You can easily test it using Snowplow Micro, either through Console or on your machine.

Input

This enrichment uses the following fields :

  • tr_currency
  • tr_total
  • tr_tax
  • tr_shipping
  • ti_currency
  • ti_price

Output

This enrichment updates the following fields of the atomic event:

FieldPurpose
base_currencyBase currency code according to ISO_4217
tr_total_baseTotal amount of transaction in base currency
tr_tax_baseTax applied in base currency
tr_shipping_baseShipping cost in base currency
ti_price_baseItem price in base currency

On this page

Want to see a custom demo?

Our technical experts are here to help.