Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards
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

2 Replies

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.

Avatar

Level 2

Sprry to piggyback ride on this, but this almost answer a question I have.

Just browsing around and came across your comment here.

We had the choice to implement our tracking with track action and track state or using edge send event. If I am understanding your comment correctly, when using edge send event, the json from the payload needs to match the schema exactly, even though it will get mapped in the datastream?

 

We were hoping to use custom user friendly parameters in the app and map to evars and props through the datastream; it looks like this will only be possible if we use track state and track action?

 

By chance do you know if thing inside of _experience.analytics.contextData  can get mapped to eVars and props?