Expand my Community achievements bar.

SOLVED

How to map json from mobile sdk to adobe eVars, Props, and events

Avatar

Level 2

We have a new event being triggered from our mobile apps and they are passing a json object. ex: {"digitalData": {"event": {"sampleEvent": "1"},"page": {"pageInfo": {"mSrc": "205"}}}}

 

What are the steps that I need to follow to set up that mapping in the processing rules?

 

When i look at the current processing rules, I see the rule looking at data being passed as context variables, so how do I get the context data listed in the drop downs in the processing rules?

 

Our person who oringinally set up rules is no longer at our company, so we have a knowledge gap in the mobile app area of adobe analytics.

 

Is there any additional requirements on the app side when they are sending this json to Adobe? Note: we are using the old SDK at this time.

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor and Adobe Champion

When you say you are using the old SDK I assume you mean the APC Core SDK (i.e. pre-data stream)??

 

If so, I don't think you can pass data as JSON... and if you are using Data Steams, that JSON needs to be in the XDM schema and use the Adobe Experience Platform Data Stream mapping.

 

 

If you are trying to use pre-stream data, then you must set context variables in your implementation, then they will show up in your processing rules for mapping.

 

In the "old" way, you need to do stuff like:

HashMap cdata = new HashMap<String, Object>();
cdata.put("UserID", "122121212121212121");
cdata.put("UserGender", "male");
cdata.put("UserAge", "18");
Analytics.trackState("Homepage", cdata); 

// OR

HashMap cdata = new HashMap<String, Object>();
cdata.put("user.id", "122121212121212121");
cdata.put("user.gender", "male");
cdata.put("user.age", "18");
Analytics.trackState("Homepage", cdata); 

 

Where user.id is a context variable...

 

I like to have a specific overall context namespace that ALL my custom context variables can be found easily, I sometimes use a simplified org name, or a site domain designation....

 

You also need to use the proper trackState (page views - s.t() equivalent) and trackAction (clicks / actions - s.tl() equivalent) in order to create a proper tracking profile.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor and Adobe Champion

When you say you are using the old SDK I assume you mean the APC Core SDK (i.e. pre-data stream)??

 

If so, I don't think you can pass data as JSON... and if you are using Data Steams, that JSON needs to be in the XDM schema and use the Adobe Experience Platform Data Stream mapping.

 

 

If you are trying to use pre-stream data, then you must set context variables in your implementation, then they will show up in your processing rules for mapping.

 

In the "old" way, you need to do stuff like:

HashMap cdata = new HashMap<String, Object>();
cdata.put("UserID", "122121212121212121");
cdata.put("UserGender", "male");
cdata.put("UserAge", "18");
Analytics.trackState("Homepage", cdata); 

// OR

HashMap cdata = new HashMap<String, Object>();
cdata.put("user.id", "122121212121212121");
cdata.put("user.gender", "male");
cdata.put("user.age", "18");
Analytics.trackState("Homepage", cdata); 

 

Where user.id is a context variable...

 

I like to have a specific overall context namespace that ALL my custom context variables can be found easily, I sometimes use a simplified org name, or a site domain designation....

 

You also need to use the proper trackState (page views - s.t() equivalent) and trackAction (clicks / actions - s.tl() equivalent) in order to create a proper tracking profile.