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
currencyCode
is 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
currencyCode
is defined and matches the report suite’s currency, no currency conversion is applied. - If
currencyCode
is 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
currencyCode
is 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 for Adobe Analytics under the XDM field commerce.order.currencyCode
.
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
trackState
ortrackAction
. - 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
products
variable in your call totrackState
ortrackAction
.
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:
AED
AFA
ALL
AMD
ANG
AOA
ARS
AUD
AWG
AZM
BAM
BBD
BDT
BGN
BHD
BIF
BMD
BND
BOB
BRL
BSD
BTN
BWP
BYR
BZD
CAD
CDF
CHF
CLP
CNY
COP
CRC
CSD
CUP
CVE
CYP
CZK
DJF
DKK
DOP
DZD
EEK
EGP
ERN
ETB
EUR
FJD
FKP
GBP
GEL
GGP
GHC
GIP
GMD
GNF
GTQ
GYD
HKD
HNL
HRK
HTG
HUF
IDR
ILS
IMP
INR
IQD
IRR
ISK
JEP
JMD
JOD
JPY
KES
KGS
KHR
KMF
KPW
KRW
KWD
KYD
KZT
LAK
LBP
LKR
LRD
LSL
LTL
LVL
LYD
MAD
MDL
MGA
MKD
MMK
MNT
MOP
MRO
MTL
MUR
MVR
MWK
MXN
MYR
MZM
NAD
NGN
NIO
NOK
NPR
NZD
OMR
PAB
PEN
PGK
PHP
PKR
PLN
PYG
QAR
ROL
RUR
RWF
SAR
SBD
SCR
SDD
SEK
SGD
SHP
SIT
SKK
SLL
SOS
SPL
SRD
SRG
STD
SVC
SYP
SZL
THB
TJS
TMM
TND
TOP
TRL
TTD
TVD
TWD
TZS
UAH
UGX
USD
UYU
UZS
VEB
VND
VUV
WST
XAF
XAG
XAU
XCD
XDR
XOF
XPD
XPF
XPT
YER
ZAR
ZMK
ZWD