Currency conversion 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:
| Parameter | Required | Description |
|---|---|---|
apiKey | ✅ | Open Exchange Rates API key. |
baseCurrency | ✅ | Currency to convert all transaction values to. |
rateAt | ✅ | Determines 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. |
accountType | ✅ | Level of Open Exchange Rates account. Must be DEVELOPER, ENTERPRISE, or UNLIMITED. |
- Console
- Self-Hosted
Configure the parameters in the Console enrichment editor. For example:
{
"accountType": "DEVELOPER",
"apiKey": "{{KEY}}",
"baseCurrency": "USD",
"rateAt": "EOD_PRIOR"
}
For Self-Hosted, provide a complete JSON. For example:
{
"schema": "iglu:com.snowplowanalytics.snowplow/currency_conversion_config/jsonschema/1-0-0",
"data": {
"enabled": false,
"vendor": "com.snowplowanalytics.snowplow",
"name": "currency_conversion_config",
"parameters": {
"accountType": "DEVELOPER",
"apiKey": "{{KEY}}",
"baseCurrency": "USD",
"rateAt": "EOD_PRIOR"
}
}
}
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_currencytr_totaltr_taxtr_shippingti_currencyti_price
Output
This enrichment updates the following fields of the atomic event:
| Field | Purpose |
|---|---|
base_currency | Base currency code according to ISO_4217 |
tr_total_base | Total amount of transaction in base currency |
tr_tax_base | Tax applied in base currency |
tr_shipping_base | Shipping cost in base currency |
ti_price_base | Item price in base currency |