Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!

pass an eVar as an array in Mobile code

Avatar

Level 3

Hi everyone,

 

I have a quick question. We need to pass a specific eVar as array in the mobile code to receive the data in adobe. Here is my though process:

i need to see if a single customer is seeing 3 offers on our app, we want to capture all the 3 offers in a single analytics call.

What we have done is :

offers: [{code1:<offer code1>, type1: <offer type1>, name1: <offer name1>},

           {code2:<offer code2>, type2: <offer type2>, name2: <offer name2>}]

We are not receiving data in Adobe so seems to be an issue. What is the correct way of passing an eVar as an array in mobile apps? How the processing rules needs to be set up for that ? Any Documentation would be of great help 

9 Replies

Avatar

Community Advisor and Adobe Champion

Adobe Analytics won't support arrays, all dimensions are simple text.. since you mentioned processing rules, I am assuming you are not trying to do this in CJA...

 

However, are you using the old ACP SDK, or are you using the newer AEP SDK and XDM Streams? Or maybe you have upgrade to XDM, but are just using the Analytics Keys to send data directly to AA dimensions or context variables?

 

We are still using the old ACP, and processing rules are pretty limited functionality, it only supports strings as well, there is also no "splitting" or processing the data into pieces.

 

However, if you are using the old ACP, or using the Analytics Keys to pass data direct to AA, I should be able to help, I have a lot of experience with Processing Rules and collecting Mobile App data, but I really need to know the end result / expectation so that I am leading you in the correct direction.

Avatar

Level 3

Hi jennifer, yes we are using old ACP trackState and trackAction functions to send data to AA

Avatar

Community Advisor and Adobe Champion

OK, so we probably have a very similar setup.

 

So what are you trying to do? Are you trying to populate your s.products variable? Or maybe set up List Vars? Those are the two most likely uses I can think of... but again, I understand your needs.

Avatar

Level 3

Okay so i will give you the scenario:

I want to capture the offers a customer is seeing. So lets say the customer is seeing 3 offers so i want o capture all the 3 offers in a array. meaning, we have offers.code and offers.type.

For offer 1, 

offers.type="value", offers.code="value"

for offer 2,

offers.type="value", offers.code="value"

 

In web we have similar setup,

offers{

(offer1)code="value", type="value";

(offer 2)code="value", type="value";

}

Now how do i ask my developers to pass the offers variable and how do i set it up in processing rules for it to receive the data in AA as an array

Avatar

Community Advisor and Adobe Champion

How is the information being collected on Web? Your data layer might be an array, but it's not "going to Adobe" as an Array, since AA only supports text.

 

I assume you are using Launch to process that array into an eVar or List, or some dimension... can you share the final output?

Avatar

Community Advisor and Adobe Champion

I am asking because in many cases, while you can collect the same information as web, in many cases you have to approach it differently.... 

 

You do not have as much control over data in Processing Rules, there are somethings (i.e. Products List) that cannot be mapped with Processing Rules, etc.

 

For mobile apps, you sometimes have to get your developers to do the work, and you simply take the results and pass it through... I know that this is less than ideal in some cases, but sadly, it is sometimes the only option....

 

Knowing the final result of the data will help me to help you get the desired result.

Avatar

Level 3

Here are the attached screenshots:

 

i am sharing 2 screenshots : 1 one from the console log(Data layer) and 1 from the (AA, how it looks )

example is of a variable. : notification which is similar to offers. It is an array

Avatar

Community Advisor and Adobe Champion

Ah, ok, so your final eVar is just a big string that looks like:

 

banner|[na]|overview-banner-top|includes unlimited Canada-U.S. calling. Available at....|account,notication|[na]|[na]|Need....

 

First off, you should know that this value is being truncated at 255 characters (so you are probably missing details that you think you are collecting, but aren't).

 

Secondly, because these values are being condensed into a single string, this will be harder to separate out to individual values later... You can't even really use classification rules because you could have any number of items being passed... and from a single string like this, you can't even reuse classifications to represent the type, name, id, etc... because only one value can be mapped at a time.. not multiple.

 

If you really want to replicate this, then you will need your developers to collapse the values to a string just like your final version... making sure that the same order of fields is used, with a pipe delimiter on your fields, and a comma delimiter for each item...

 

Basically, you will need to tell your devs to create a context variable string that contains "banner|[na]|overview-banner-top|includes unlimited Canada-U.S. calling. Available at....|account,notication|[na]|[na]|Need...." and pass that... then you just map that single context variable into your eVar27.

 

 

Or, you might want to consider changing your approach to using a list variable, using a similar structure, but allowing each item to be recorded separately. Lists act like eVars, except that each item in the list is limited to 255 characters, and you can pass as many items as you want.

 

You can send the information the exact same way into your list:

s.list1 = "banner|[na]|overview-banner-top|includes unlimited Canada-U.S. calling. Available at....|account,notication|[na]|[na]|Need....";

 

But, the difference is that you will set up "," as your delimiter. This will result in each item coming through on a separate row in your table:

 

  1. banner|[na]|overview-banner-top|includes unlimited Canada-U.S. calling. Available at....|account
  2. notication|[na]|[na]|Need....

 

You can then create classifications on your list for "type", "name", "id", "message" and "position"

 

But since each line will be processed individually, you can get all the data from all notifications processed.

 

So if you look at Classification "Type", you will get:

  1. banner
  2. notification

 

 

For you mobile app, you will still need your developers to make the entire thing a string that follows the exact pattern.. but instead of passing it to an eVar, you would pass it to a List dimension....

 

 

Anyway, the mobile app solution is the same.. you cannot pass an array, or map that array in processing rules... you will need to instruct your developers to build out the entire string, setting all the proper order of values and delimiters.

Avatar

Community Advisor and Adobe Champion

I have something similar in our apps, this is how I would instruct / create the requirements for our developers:

 

---------------------------------

For the array of notification data, please create a string of all the data in the following order:

 

{type}|{name}|{id}|{message}|{position}

 

Delimit each notification with a comma.

 

// Provide an example of the JSON / Array

// Provide an example of the final string

// Tell them what context variable name you want it passed as

------------------------------