currencyCode
For sites using commerce, revenue and currency is an important part of Analytics. Many sites, especially those that span multiple countries, use different currencies. Use the currencyCode variable to make sure that revenue attributes to the correct currency.
Currency conversion uses the following logic on each hit. These steps apply to revenue values set the products variable and all events listed as ‘Currency’ in Success events under Report suite settings.
- If
currencyCodeis not defined, Adobe assumes that all currency values are the report suite’s currency. See General Account Settings in Report suite settings to see the report suite’s currency. - If
currencyCodeis defined and matches the report suite’s currency, no currency conversion is applied. - If
currencyCodeis defined and is different than the report suite’s currency, Adobe applies a currency conversion based on the current day’s exchange rate. Adobe partners with XE to convert currency each day. All values stored in the report suite are in the report suite’s currency. - If
currencyCodeis set to an invalid value, the entire hit is discarded causing data loss. Make sure that this variable is correctly defined whenever used.
This variable does not persist across hits. Make sure that this variable is defined on every page that involves revenue or currency events that don’t match the report suite’s default currency.
A period must be used as the currency separator for all currencies when implementing this variable. For example, Swedish Krona, which typically displays a comma separator, must be modified to use a period in the products variable and all currency events. Adobe displays the correct currency separator in reporting.
Currency code using the Web SDK
Currency code is mapped to the following variables:
- XDM object:
xdm.commerce.order.currencyCode - Data object:
data.__adobe.analytics.currencyCodeordata.__adobe.analytics.cc
Currency Code using the Adobe Analytics extension
Currency Code is a field under the General accordion when configuring the Adobe Analytics extension.
- Log in to Adobe Experience Platform Data Collection using your AdobeID credentials.
- Click the desired tag property.
- Go to the Extensions tab, then click the Configure button under Adobe Analytics.
- Expand the General accordion, which reveals the Currency Code field.
You can use either a preset currency code or a custom currency code. If using a custom currency code, make sure that the code is valid.
Currency Code in Adobe Experience Platform Mobile SDK
Currency Code is passed to the Adobe Experience Platform Mobile SDKs through context data variables in the Adobe Analytics extension.
- Set the currency code in a context data variable during either
trackStateortrackAction. - Create a processing rule in Adobe Analytics Admin Tools for the report suite. Set the rule to overwrite the Currency Code variable.
- Pass the currency code to the
productsvariable in your call totrackStateortrackAction.
You can use either a preset currency code or a custom currency code. If using a custom currency code, make sure that the code is valid.
s.currencyCode in AppMeasurement and the Analytics extension custom code editor
The s.currencyCode variable is a string, containing a 3-letter uppercase code representing the currency on the page. Values are case-sensitive.
s.currencyCode = "USD";
The following currency codes are valid:
AEDAFAALLAMDANGAOAARSAUDAWGAZMBAMBBDBDTBGNBHDBIFBMDBNDBOBBRLBSDBTNBWPBYRBZDCADCDFCHFCLPCNYCOPCRCCSDCUPCVECYPCZKDJFDKKDOPDZDEEKEGPERNETBEURFJDFKPGBPGELGGPGHCGIPGMDGNFGTQGYDHKDHNLHRKHTGHUFIDRILSIMPINRIQDIRRISKJEPJMDJODJPYKESKGSKHRKMFKPWKRWKWDKYDKZTLAKLBPLKRLRDLSLLTLLVLLYDMADMDLMGAMKDMMKMNTMOPMROMTLMURMVRMWKMXNMYRMZMNADNGNNIONOKNPRNZDOMRPABPENPGKPHPPKRPLNPYGQARROLRURRWFSARSBDSCRSDDSEKSGDSHPSITSKKSLLSOSSPLSRDSRGSTDSVCSYPSZLTHBTJSTMMTNDTOPTRLTTDTVDTWDTZSUAHUGXUSDUYUUZSVEBVNDVUVWSTXAFXAGXAUXCDXDRXOFXPDXPFXPTYERZARZMKZWD