Get Recommendations with custom params in mobile | Community
Skip to main content
July 15, 2020
Solved

Get Recommendations with custom params in mobile

  • July 15, 2020
  • 1 reply
  • 2191 views

I am trying to integrate the recommendations in my mobile app for both Android and iOS. So far things that I have done are :-

1. created a recommendation in target, whose main purpose would be to give results based on the country.

This is what my criteria looks like : 

 

and this is how I choose the key

And then in design, I am returning the json which looks something like this

Also I have uploaded a .csv file, which is used to feed the data.

 

And I am calling my recommendation as:

customParameters.put("enitity.id","mexico"); //hashmap has been created

TargetLocationRequest loadActivity = Target.createRequest("mobile_featured_destinations",null,customParameters);
Target.loadRequest(loadActivity, new Target.TargetCallback<String>() {

@Override
public void call(String callback) {
System.out.println("callback received from target: "+mboxName+ "is: "+callback);
}

Now the results that I am getting are same irrespective of whatever value I pass, as I am expecting that on passing "india", the recommendation order will change as mentioned in the feed, but it's not happening. Is there anything I am missing, or understanding and implementing it incorrectly. 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ryanr7

Hi @bhavna18 

How is the user.country being set? Is that a profile script that returns the visitor's county based on some geo lookup? If so, you don't need to pass an entity.id in the request to Target. The profile script will run and provide the "key" for the recommendations. You wouldn't be able to "spoof" other keys though unless you can get the profile script to return a different value.

However, if you are wanting to pass the country directly to Target as the key/id you can do that too. To make that work I'd keep the criteria key as current item and then pass the entity.id of the country in the request.

Hope that helps.

1 reply

ryanr7Adobe EmployeeAccepted solution
Adobe Employee
July 15, 2020

Hi @bhavna18 

How is the user.country being set? Is that a profile script that returns the visitor's county based on some geo lookup? If so, you don't need to pass an entity.id in the request to Target. The profile script will run and provide the "key" for the recommendations. You wouldn't be able to "spoof" other keys though unless you can get the profile script to return a different value.

However, if you are wanting to pass the country directly to Target as the key/id you can do that too. To make that work I'd keep the criteria key as current item and then pass the entity.id of the country in the request.

Hope that helps.

Adobe Employee
July 16, 2020
If you tweaked the criteria key to be current item and are passing the entity.id as a customer paramter with a value of mexico you should be getting results back as defined in your uploaded custom criteria. Though I do see an upload error on your criteria screen shot has that been fixed? Otherwise you might be getting backup recommendations.