Multiple Context Data in a single trackState Or trackAction

Avatar

Avatar

julienp80647070

Avatar

julienp80647070

julienp80647070

06-12-2017

Hello,

I am looking at the different documentation for the iOS and Android SDK and I am not sure if it is possible to send different context variable within the same State or Action.

Documentation State for iOS & Android:

It seems incredible that it is not possible, but how would you write that ?

@Override

public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

    // Adobe - track when this state loads

    HashMap<String, Object> exampleContextData1 = new HashMap<String, Object>();

    exampleContextData1.put("myapp.login.LoginStatus", "logged in");

    HashMap<String, Object> exampleContextData2 = new HashMap<String, Object>();

    exampleContextData2.put("myapp.login.Template", "templateB");

    Analytics.trackState("Home Screen", exampleContextData1,exampleContextData2);

}

Any help, would be appreciated.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

jacobh35707634

Employee

Avatar

jacobh35707634

Employee

jacobh35707634
Employee

06-12-2017

Put each context data value in the same HashMap, and then pass one HashMap to the track call:

    // Adobe - track when this state loads  

    HashMap<String, Object> exampleContextData1 = new HashMap<String, Object>(); 

    exampleContextData1.put("myapp.login.LoginStatus", "logged in"); 

    exampleContextData1.put("myapp.login.Template", "templateB"); 

 

    Analytics.trackState("Home Screen", exampleContextData1);

Answers (1)

Answers (1)

Avatar

Avatar

julienp80647070

Avatar

julienp80647070

julienp80647070

08-12-2017

Thanks for your answer.
It exactly what I was looking for.