Expand my Community achievements bar.

SOLVED

Custom currency code

Avatar

Level 2

We're implementing Adobe Analytics for a eCommerce site that has different currencies, depending which country you are in (i.e. Sweden gives you price in SEK, Germany in EUR, etc.). When a purchase is completed, the following is pushed to digitalData: 

 

"transaction": {
"transactionID": "1234567",
"total": {
"Price": {{PRICE}},
"currency": "{{CURRENCY}}" // e.g. SEK, USD, EUR
}

 

According to the docs, in such as scenario you can change the currency from a preset to custom, inside the Adobe Analytics extension in Adobe Launch. I changed to custom, and am referencing a variable whose property path is transaction.total.currency (this should match the path from the code above). EDIT: I know its collecting the currency correctly, because I also set a eVar which is showing me e.g. "SEK" in the AEP debugger extension

 

However, it still doesn't seem to be reporting this correctly in Workspace. What am I doing wrong? How can I debug/troubleshoot this to check that it's actually working when I do test purchase? 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Are you setting the "Currency Code" field correctly in the AA extension? See What is the currencyCode variable, and how do I use it? | Adobe Analytics.

View solution in original post

11 Replies

Avatar

Correct answer by
Community Advisor

Are you setting the "Currency Code" field correctly in the AA extension? See What is the currencyCode variable, and how do I use it? | Adobe Analytics.

Avatar

Level 2
Thanks for the prompt reply! I'm not sure - assuming I'm not setting it correctly, what would be the correct way to set the "currency code" field, if I want to use custom currency?

Avatar

Community Advisor
If you've chosen the "Custom" radio button, then I think your best bet is to use a data element that returns the currency code for the purchase's currency. E.g. you can create a data element of a JavaScript variable type, and the path is "digitalData.transaction.total.currency".

Avatar

Level 2

Thanks! Yeah I already am - I'm using an extension in the data element called "Data Layer Manager" which already references "window.digitalData", so I just need to write in whatever comes after that. Again, I've written "transaction.total.currency", and when I debug a test purchase I can also see from an eVar that I've set, that it collects e.g. "SEK". But the revenue pr order is still crazy high, so it seems like Adobe is still reporting revenue in Swedish Kroner price instead of Euro, which is the currency for the report suite. Do you know if there's a way to debug which currency Adobe registers upon a purchase?

Avatar

Community Advisor

You can use the Adobe Experience Cloud Debugger to debug your AA hits.

Also, try this: instead of setting the currency code in the extension settings itself, set it together in the "Set Variables" action where you set your eVar. You can set it in the Custom Code section of the Set Variables action using: 

s.currencyCode = _satellite.getVar('your data element name');

Avatar

Level 2
I think that worked with s.currency!! Thanks so much! Bit curious still why that would work, and not via the extension... but oh well Thanks again!!

Avatar

Community Advisor
It's because of how/when your currency code is being set in your digitalData. It's only set when the transaction data is set in your digitalData, so you can really only read that in your AA Set Variables at that moment, and not before.

Avatar

Level 2
That makes sense so in order for it to work via the extension, we would have to push currency to digitalData on every page load essentially?

Avatar

Community Advisor
Yup. Or if you only need to track it when purchases are tracked, then you can do so at that step only.

Avatar

Level 10

1) Just in case you expected the amount in different currencies, Workspace will report revenue in the currency set in the report suite settings. So if it's set to USD and you collect data in SEK, the SEK amount will be converted in USD and reported in Workspace in USD.

2) If you are concerned with the FX rate, Adobe may use the rates that do not match the ones you use.