App tracking: Currencycode variable

Avatar

Avatar
Validate 1
Level 1
jacobs84905156
Level 1

Likes

0 likes

Total Posts

29 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
jacobs84905156
Level 1

Likes

0 likes

Total Posts

29 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
jacobs84905156
Level 1

29-06-2021

According to Adobe's docs, you set the currency code via the following steps: 

  1. Set the currency code in a context data variable during either trackState or trackAction.
  2. Create a processing rule in the Adobe Analytics admin console for the report suite. Set the rule to overwrite the Currency Code variable.
  3. Pass the currency code to the products variable in your call to trackState or trackAction.

 

SEE CODE IN COMMENTS

 

However, when I look in Adobe Analytics, it doesn't report the currency correctly (A t-shirt in 500 DKK is reported as 500 EUR instead of 67 EUR). I'm guessing we're not passing the currency code correctly, but not sure how exactly to correct it? 

Accepted Solutions (0)

Answers (3)

Answers (3)

Avatar

Avatar
Seeker
Level 4
vibhatna
Level 4

Likes

43 likes

Total Posts

112 posts

Correct reply

23 solutions
Top badges earned
Seeker
Engage 1
Boost 25
Affirm 10
Give Back
View profile

Avatar
Seeker
Level 4
vibhatna
Level 4

Likes

43 likes

Total Posts

112 posts

Correct reply

23 solutions
Top badges earned
Seeker
Engage 1
Boost 25
Affirm 10
Give Back
View profile
vibhatna
Level 4

29-06-2021

Sure @jacobs84905156 

You can try this as per https://gist.github.com/jacobsander/9ae6c419a63fd44eea7ae5b694a3d533

Once implemented please check if Currency code is being fired outside "c." and ".c" or inside? It should be fired outside these parameters. 

 

Avatar

Avatar
Seeker
Level 4
vibhatna
Level 4

Likes

43 likes

Total Posts

112 posts

Correct reply

23 solutions
Top badges earned
Seeker
Engage 1
Boost 25
Affirm 10
Give Back
View profile

Avatar
Seeker
Level 4
vibhatna
Level 4

Likes

43 likes

Total Posts

112 posts

Correct reply

23 solutions
Top badges earned
Seeker
Engage 1
Boost 25
Affirm 10
Give Back
View profile
vibhatna
Level 4

29-06-2021

@jacobs84905156 .

Could you please try below mentioned syntax:

HashMap<String, Object> cdata = new HashMap<String, Object>();
                    cdata.put("testcontext", "Context Data trackAction button");
                    cdata.put("&&currencyCode", "DKK");
                    //cdata.put("&&cc", "Context Data trackAction button");
                    //Send Adobe Analytics trackAction with contextData
                    Analytics.trackAction("TrackAction", cdata);

Or

cdata.put("&&cc", "DKK");

Here we are applying && to make sure that currencyCode is fired as query string parameter in the Adobe server call and conversion happens.

The currency code requires the double ampersands because it appears as though the currency conversion occurs prior to context data processing. Setting the currency code as context data might not work for currency conversion.

Avatar

Avatar
Boost 25
Level 3
amgup
Level 3

Likes

26 likes

Total Posts

132 posts

Correct reply

16 solutions
Top badges earned
Boost 25
Affirm 10
Boost 5
Boost 3
Boost 10
View profile

Avatar
Boost 25
Level 3
amgup
Level 3

Likes

26 likes

Total Posts

132 posts

Correct reply

16 solutions
Top badges earned
Boost 25
Affirm 10
Boost 5
Boost 3
Boost 10
View profile
amgup
Level 3

29-06-2021

decO@jacobs84905156 I am not sure which CODE you are referring here. Processing rules in Analytics are used to overwrite value or delete value or setting an event as per the defined rules. From the description I am assuming that you are trying to convert the sent 500 DKK to 67 EUR by using processing rule. If this is the case then can you please share the screenshot of the processing rule where you have set this rule ?