Create Social Proof Actions
Social proof is a demonstration that other people have purchased or found value in a product or service. This demonstration helps the product or service stand out from others and makes the customer more likely to purchase it. These demonstrations often reflect existing customer behavior. For example, labelling a product as a bestseller is a social proof demonstration.
You can set up a handler for Omnichannel Social Proof actions using two methods. The addEvent method defines the events that can trigger the action. The getActionsData method is then used as the trigger and requests the decision based on the defined events. getActionsData then returns a JSON object containing social proof data that you can then handle in code.
Prerequisites
You must first create an Omnichannel Social Proof action in the Monetate platform for the methods to reference. Refer to Configure an Omnichannel Social Proof Action in the Monetate Knowledge Base for instructions.
Make note of the WHO settings because they correspond to events your code listens for. The example experience in this article uses the following WHO settings:
- IP address is 1.0.0.2
- Screen height is at least 500 pixels and screen width is at least 300 pixels
Also make note of the Social Proof type that you're creating.
The full code examples fulfill these conditions and will trigger the Social Proof action.
addEvent
This method adds event data to the SDK's internal stack.
addEvent(context: EventTypes, events: ContextData): voidThe parameters are as follows:
- context is name of the event.
- events is the event data.
addEvent(context: EventTypes, events: ContextData): voidThe parameters are as follows:
- context is name of the event.
- events is the event data.
addEvent(context: <ContextEnum>, event: <MEvent?>)The parameters are as follows:
- context is name of the event. (Required)
- event is the event data. (Required)
public void addEvent(String context, Object event)The parameters are as follows:
- context is name of the event. (Required)
- event is the event data. (Required)
You can use this method multiple times to add all the necessary events for an experience you want to trigger. The example code uses multiple method calls to fulfill the experience requirements.
Code Example
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});objPersonalization.addEvent(context: .ScreenSize, event: ScreenSize(height: 1000, width: 400))
objPersonalization.addEvent(context: .IpAddress, event: IPAddress(ipAddress: "192.168.1.52")) IpAddress ipAddress = new IpAddress();
ipAddress.setIpAddress("10.0.0.2");
ScreenSize screenSize = new ScreenSize();
screenSize.setHeight(23);
screenSize.setWidth(34);
PageView pageView = new PageView();
pageView.setPageType("Cartpage");
pageView.setUrl("https://www.monetate.com");
// addEvent
personalization.addEvent(EventTypes.ContextScreenSize, screenSize);
personalization.addEvent(EventTypes.ContextIpAddress, ipAddress);
personalization.addEvent(EventTypes.ContextPageView, pageView);getActionsData
This method sends the defined events to Monetate to trigger an experience. If the events fulfill the WHO settings and the other required conditions of an experience, that experience is triggered. A JSON object containing the experience response is then returned.
getActionsData(actionType: Array<string>, includeReporting?: boolean) : Promise<any>The parameter is as follows:
- actionType is the type of action you want to request. You can specify one action or multiple actions in an array to handle.
- includeReporting indicates whether the response will have impression reporting data.
getActionsData(actionType: Array<string>, includeReporting?: boolean) : Promise<any>The parameter is as follows:
- actionType is the type of action you want to request. You can specify one action or multiple actions in an array to handle.
- includeReporting indicates whether the response will have impression reporting data.
getActionsData(requestId: <String>, includeReporting: <Bool>, arrActionTypes: <[String]>The parameters are as follows:
- requestID is the request ID for the API.
- actionType is the type of action you want to request. You can specify one action or multiple actions in an array to handle.
- includeReporting indicates whether the response will have impression reporting data.
public String getActionsData(String[] actionTypes, boolean includeReports)The parameters are as follows:
- actionTypes is the type of action you want to request. You can specify one action or multiple actions in an array to handle.
- includeReports indicates whether the response will have impression reporting data.
Code Example
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:SocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});let socialProofData;
personalizationInstance
.getActionsData("monetate:action:SocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});objPersonalization.getActionsData(
requestId: "123456 ", includeReporting: false,
arrActionTypes: ["monetate:action:SocialProofDataV2"]
)
.on { res in
if res.status == 200 {
let data = JSON(res.data as Any)
for item in data["data"]["responses"].arrayValue {
if item["requestId"].string == res.requestId {
for socialProof in item["actions"].arrayValue {
self.handleSocialProofs(res: socialProof)
}
}
}
} else {
// Error Handling
}
}String responseData = personalization.getActionsData(new String[]{"monetate:action:SocialProofDataV2"},true);The following code examples are for each type of Social Proof messaging.
This Social Proof type displays the message on products as determined by the number of times customers viewed a specific product detail page.
// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextPageView, {
url: "http://www.monetate.com/index.html",
pageType: "Home"
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextPageView, {
url: "http://www.monetate.com/index.html",
pageType: "Home"
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});This Social Proof type requires the ContextPageView event to be added.
// Add Context / Events
//-------------------------------------------------------------------------
objPersonalization.addEvent(context: .ScreenSize, event: ScreenSize(height: 1000, width: 400))
objPersonalization.addEvent(context: .IpAddress, event: IPAddress(ipAddress: "192.168.1.52"))
objPersonalization.addEvent(
context: .PageView,
event: PageView(pageType: "PDP", path: "n/a", url: "n/a", categories: [], breadcrumbs: []))
// Get Social Proof Actions
// ----------------------------------------------------
objPersonalization.getActionsData(
requestId: "123456", includeReporting: false,
arrActionTypes: ["monetate:action:SocialProofDataV2"]
)
.on { res in
if res.status == 200 {
let data = JSON(res.data as Any)
for item in data["data"]["responses"].arrayValue {
if item["requestId"].string == res.requestId {
for socialProof in item["actions"].arrayValue {
self.handleSocialProofs(res: socialProof)
}
}
}
} else {
// Error Handling
}
}You must handle the getActions method in a Thread or AsyncTask. To update the main thread, you can use either Handler or runOnUiThread. This full code example uses Thread and Handler to update the main thread and change the UI.
Personalization personalization = new personalization(user, account);
// Events/context data
Product product = new Product();
product.setProductId("97");
product.setSku("SKU");
ProductDetailView productDetailView = new ProductDetailView();
productDetailView.setProducts(new Product[]
{
product
});
PageView pageView = new PageView();
pageView.setPageType("Cartpage");
pageView.setUrl("https://www.monetate.com");
// addEvent
personalization.addEvent(EventTypes.ContextProductDetailView, productDetailView);
personalization.addEvent(EventTypes.ContextPageView, pageView);
// getActionsData
String responseData;
new Thread(new Runnable()
{
@Override
public void run()
{
// Get the responseData using getActionsData
responseData = personalization.getActionsData("monetate:action:SocialProofDataV2");
// Once you receive the responseData from getActionsData, use the Handler and parse the required data
new Handler(Looper.getMainLooper()).post(new Runnable()
{
@Override
public void run()
{
// Parse the received responseData, get the requiredData from it and use it accordingly
try
{
// Example: textView.setText(requiredData);
}
catch (Exception ex)
{
// Catch any exception that occured while parsing
ex.printStackTrace();
}
}
});
}
}).start();Supported SDK Versions
- Android: 1.0.6-A or later
- React-Native: 1.0.6-RN or later
- Web: 1.0.6-W or later
- iOS: 2026.01.06 or later
let contextObj = ContextObj()
let productsSample = [
Product(productId: "PROD001", sku: "SKU001")
]
contextObj.addProductDetails(productsSample)
contextObj.addPageDetails(pageType: "PDP", path: "n/a", url: "n/a", categories: [], breadcrumbs: [])
objPersonalization.getActions(context: contextObj, arrActionTypes: ["monetate:action:SocialProofDataV2"], includeReporting: false)
.on(success: { (actions) in
self.handleSocialProof(actions: actions)
})
Context context = new Context();
context.addProductDetails(new Product[] {new Product("97", "sku")});
context.addPageDetails("Cartpage", "https://www.monetate.com", new String[] {"categories-here"},new String[] {"breadcrums--here"},"test/path");
personalization.getActions(context, new String[] {"monetate:action:SocialProofDataV2"}, false,new ActionsCallback() {
@Override
public void onSuccess(String actions) {
System.out.println("Action data :"+actions);
}
@Override
public void onError(Exception e) {
System.out.println("Ex :"+e);
}
});
const context = new Context();
context
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));const context = new Context();
context
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));This Social Proof type displays the message on products most frequently added to a cart. To target product detail pages, you must add the ContextProductDetailView event.
// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductDetailView, {
products: [
{
productId: "94",
sku: "sku",
},
],
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductDetailView, {
products: [
{
productId: "94",
sku: "sku",
},
],
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
objPersonalization.addEvent(context: .ScreenSize, event: ScreenSize(height: 1000, width: 400))
objPersonalization.addEvent(context: .IpAddress, event: IPAddress(ipAddress: "192.168.1.52"))
objPersonalization.addEvent(
context: .ProductDetailView,
event: ProductDetailView(products: [Product(productId: "BackP_010", sku: "Blue_BackP_010")]))
// Get Social Proof Actions
// ----------------------------------------------------
objPersonalization.getActionsData(
requestId: "123456", includeReporting: false,
arrActionTypes: ["monetate:action:SocialProofDataV2"]
)
.on { res in
if res.status == 200 {
let data = JSON(res.data as Any)
for item in data["data"]["responses"].arrayValue {
if item["requestId"].string == res.requestId {
for socialProof in item["actions"].arrayValue {
self.handleSocialProofs(res: socialProof)
}
}
}
} else {
// Error Handling
}
}
You must handle the getActions method in a Thread or AsyncTask. To update the main thread, you can use either Handler or runOnUiThread. This full code example uses Thread and Handler to update the main thread and change the UI.
// Add Context and Events
Product product = new Product();
product.setProductId("97");
product.setSku("SKU");
ProductDetailView productDetailView = new ProductDetailView();
productDetailView.setProducts(new Product[]
{
product
});
PageView pageView = new PageView();
pageView.setPageType("Cartpage");
pageView.setUrl("https://www.monetate.com");
// addEvent
personalization.addEvent(EventTypes.ContextProductDetailView, productDetailView);
personalization.addEvent(EventTypes.ContextPageView, pageView);
// Get Social Proof Actions
// getActionsData
String responseData;
new Thread(new Runnable()
{
@Override
public void run()
{
// Gets the responseData using getActionsData
responseData = personalization.getActionsData(new String[]
{
"monetate:action:SocialProofDataV2"
}, true);
// Once you receive the responseData from getActionsData, use the Handler and parse the required data from it
new Handler(Looper.getMainLooper()).post(new Runnable()
{
@Override
public void run()
{
// Parse the received responseData, get the requiredData from it and use it accordingly
try
{
// Example: textView.setText(requiredData);
}
catch (Exception ex)
{
// Catch any exception that occurs while parsing
ex.printStackTrace();
}
}
});
}
}).start();Supported SDK Versions
- Android: 1.0.6-A or later
- React-Native: 1.0.6-RN or later
- Web: 1.0.6-W or later
- iOS: 2026.01.06 or later
let contextObj = ContextObj()
let productsSample = [
Product(productId: "PROD001", sku: "SKU001")
]
contextObj.addProductDetails(productsSample)
contextObj.addPageDetails(pageType: "PDP", path: "n/a", url: "n/a", categories: [], breadcrumbs: [])
objPersonalization.getActions(context: contextObj, arrActionTypes: ["monetate:action:SocialProofDataV2"], includeReporting: false)
.on(success: { (actions) in
self.handleSocialProof(actions: actions)
})
}
Context context = new Context();
context.addProductDetails(new Product[] {new Product("97", "sku")});
context.addPageDetails("Cartpage", "https://www.monetate.com", new String[] {"categories-here"},new String[] {"breadcrums--here"},"test/path");
personalization.getActions(context, new String[] {"monetate:action:SocialProofDataV2"}, false,new ActionsCallback() {
@Override
public void onSuccess(String actions) {
System.out.println("Action data :"+actions);
}
@Override
public void onError(Exception e) {
System.out.println("Ex :"+e);
}
});
const context = new Context();
context
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));
const context = new Context();
context
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));This code example is for displaying a Social Proof message on the products most frequently added to a cart on page types that contain multiple product IDs, such as product category listings, search results pages, and cart pages. To target multi-PID pages, you must add the ProductThumbnailView event.
// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductThumbnailView, {
"products": ["104","94","97" ]
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductThumbnailView, {
"products": ["104","94","97" ]
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
objPersonalization.addEvent(context: .ScreenSize, event: ScreenSize(height: 1000, width: 400))
objPersonalization.addEvent(context: .IpAddress, event: IPAddress(ipAddress: "192.168.1.52"))
objPersonalization.addEvent(
context: .ProductThumbnailView,
event: ProductThumbnailView(products: Set(["BackP_010", "BackP_011"])))
// Get Social Proof Actions
// ----------------------------------------------------
objPersonalization.getActionsData(
requestId: "123456", includeReporting: false,
arrActionTypes: ["monetate:action:SocialProofDataV2"]
)
.on { res in
if res.status == 200 {
let data = JSON(res.data as Any)
for item in data["data"]["responses"].arrayValue {
if item["requestId"].string == res.requestId {
for socialProof in item["actions"].arrayValue {
self.handleSocialProofs(res: socialProof)
}
}
}
} else {
// Error Handling
}
}You must handle the getActions method in a Thread or AsyncTask. To update the main thread, you can use either Handler or runOnUiThread. This full code example uses Thread and Handler to update the main thread and change the UI.
// Add Context and Events
ProductThumbnailView productThumbnailView = new ProductThumbnailView();
productThumbnailView.setProducts(new String[]
{
"94",
"97",
"104"
});
PageView pageView = new PageView();
pageView.setPageType("Cartpage");
pageView.setUrl("https://www.monetate.com");
// addEvent
personalization.addEvent(EventTypes.ContextProductThumbnailView, productThumbnailView);
personalization.addEvent(EventTypes.ContextPageView, pageView);
// Get Social Proof Actions
// getActionsData
String responseData;
new Thread(new Runnable()
{
@Override
public void run()
{
// Gets the responseData using getActionsData
responseData = personalization.getActionsData(new String[]
{
"monetate:action:SocialProofDataV2"
}, true);
// Once you receive the responseData from getActionsData, use the Handler and parse the required data from it
new Handler(Looper.getMainLooper()).post(new Runnable()
{
@Override
public void run()
{
// Parse the received responseData, get the requiredData from it and use it accordingly
try
{
// Example: textView.setText(requiredData);
}
catch (Exception ex)
{
// Catch any exception that occurs while parsing
ex.printStackTrace();
}
}
});
}
}).start();Supported SDK Versions
- Android: 1.0.6-A or later
- React-Native: 1.0.6-RN or later
- Web: 1.0.6-W or later
- iOS: 2026.01.06 or later
let contextObj = ContextObj()
contextObj.addProductThumbnailsData(["PROD001", "PROD002", "PROD003"])
contextObj.addPageDetails(pageType: "PDP", path: "n/a", url: "n/a", categories: [], breadcrumbs: [])
objPersonalization.getActions(context: contextObj, arrActionTypes: ["monetate:action:SocialProofDataV2"], includeReporting: false)
.on(success: { (actions) in
self.handleSocialProof(actions: actions)
})
}
Context context = new Context();
context.addProductThumbnailsData(new String[] {"104", "94", "97"});
context.addPageDetails("Cartpage", "https://www.monetate.com", new String[] {"categories-here"},new String[] {"breadcrums--here"},"test/path");
personalization.getActions(context, new String[] {"monetate:action:SocialProofDataV2"}, false,new ActionsCallback() {
@Override
public void onSuccess(String actions) {
System.out.println("Action data :"+actions);
}
@Override
public void onError(Exception e) {
System.out.println("Ex :"+e);
}
});
const context = new Context();
context
.addProductThumbnailsData()
.product([
"prod_101",
"prod_102",
"prod_103"
]);
Personalization.getActions(
["monetate:action:OmniChannelImageBadging"],
context)
.then((res: any) => console.log("Action === 1 res", res));const context = new Context();
context
.addProductThumbnailsData()
.product([
"prod_101",
"prod_102",
"prod_103"
]);
Personalization.getActions(
["monetate:action:OmniChannelImageBadging"],
context)
.then((res: any) => console.log("Action === 1 res", res));This Social Proof type displays a message on products most frequently purchased. To target product detail pages, you must add the ContextProductDetailView event.
// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductDetailView, {
products: [{productId: "94",sku: "sku"}],
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductDetailView, {
products: [{productId: "94",sku: "sku"}],
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
objPersonalization.addEvent(context: .ScreenSize, event: ScreenSize(height: 1000, width: 400))
objPersonalization.addEvent(context: .IpAddress, event: IPAddress(ipAddress: "192.168.1.52"))
objPersonalization.addEvent(
context: .ProductDetailView,
event: ProductDetailView(products: [Product(productId: "BackP_010", sku: "Blue_BackP_010")]))
// Get Social Proof Actions
// ----------------------------------------------------
objPersonalization.getActionsData(
requestId: "123456", includeReporting: false,
arrActionTypes: ["monetate:action:SocialProofDataV2"]
)
.on { res in
if res.status == 200 {
let data = JSON(res.data as Any)
for item in data["data"]["responses"].arrayValue {
if item["requestId"].string == res.requestId {
for socialProof in item["actions"].arrayValue {
self.handleSocialProofs(res: socialProof)
}
}
}
} else {
// Error Handling
}
}You must handle the getActions method in a Thread or AsyncTask. To update the main thread, you can use either Handler or runOnUiThread. This full code example uses Thread and Handler to update the main thread and change the UI.
// Add Context and Events
Product product1 = new Product();
product1.setProductId("97");
product1.setSku("SKU");
ProductDetailView productDetailView = new ProductDetailView();
productDetailView.setProducts(new Product[]
{
product1
});
PageView pageView = new PageView();
pageView.setPageType("Cartpage");
pageView.setUrl("https://www.monetate.com");
// addEvent
personalization.addEvent(EventTypes.ContextProductDetailView, productDetailView);
personalization.addEvent(EventTypes.ContextPageView, pageView);
// Get Social Proof Actions
// getActionsData
String responseData;
new Thread(new Runnable()
{
@Override
public void run()
{
// Gets the responseData using getActionsData
responseData = personalization.getActionsData(new String[]
{
"monetate:action:SocialProofDataV2"
}, true);
// Once you receive the responseData from getActionsData, use the Handler and parse the required data from it
new Handler(Looper.getMainLooper()).post(new Runnable()
{
@Override
public void run()
{
// Parse the received responseData, get the requiredData from it and use it accordingly
try
{
// Example: textView.setText(requiredData);
}
catch (Exception ex)
{
// Catch any exception that occurs while parsing
ex.printStackTrace();
}
}
});
}
}).start();Supported SDK Versions
- Android: 1.0.6-A or later
- React-Native: 1.0.6-RN or later
- Web: 1.0.6-W or later
- iOS: 2026.01.06 or later
This Social Proof type displays a message on products most frequently purchased. To target product detail pages, you must add the ContextProductDetailView event.
let contextObj = ContextObj()
let productsSample = [
Product(productId: "PROD001", sku: "SKU001")
]
contextObj.addProductDetails(productsSample)
contextObj.addPageDetails(pageType: "PDP", path: "n/a", url: "n/a", categories: [], breadcrumbs: [])
objPersonalization.getActions(context: contextObj, arrActionTypes: ["monetate:action:SocialProofDataV2"], includeReporting: false)
.on(success: { (actions) in
self.handleSocialProof(actions: actions)
})
Context context = new Context();
context.addProductDetails(new Product[] {new Product("97", "sku")});
context.addPageDetails("Cartpage", "https://www.monetate.com", new String[] {"categories-here"},new String[] {"breadcrums--here"},"test/path");
personalization.getActions(context, new String[] {"monetate:action:SocialProofDataV2"}, false,new ActionsCallback() {
@Override
public void onSuccess(String actions) {
System.out.println("Action data :"+actions);
}
@Override
public void onError(Exception e) {
System.out.println("Ex :"+e);
}
});const context = new Context();
context.
addProductDetails().
productId("123").
productSKU("SKU-123")
personalization.ProductDetails();
context
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));const context = new Context();
context.
addProductDetails().
productId("123").
productSKU("SKU-123")
personalization.ProductDetails();
context
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));This Social Proof type displays a message on products most frequently purchased. To target page types that contain multiple product IDs—such as product category listings, search results pages, and cart pages—you must add the ProductThumbnailView event.
// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductThumbnailView, {
"products": ["88","86","97" ]
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductThumbnailView, {
"products": ["88","86","97" ]
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
objPersonalization.addEvent(context: .ScreenSize, event: ScreenSize(height: 1000, width: 400))
objPersonalization.addEvent(context: .IpAddress, event: IPAddress(ipAddress: "192.168.1.52"))
objPersonalization.addEvent(
context: .ProductThumbnailView,
event: ProductThumbnailView(products: Set(["BackP_010", "BackP_011"])))
// Get Social Proof Actions
// ----------------------------------------------------
objPersonalization.getActionsData(
requestId: "123456", includeReporting: false,
arrActionTypes: ["monetate:action:SocialProofDataV2"]
)
.on { res in
if res.status == 200 {
let data = JSON(res.data as Any)
for item in data["data"]["responses"].arrayValue {
if item["requestId"].string == res.requestId {
for socialProof in item["actions"].arrayValue {
self.handleSocialProofs(res: socialProof)
}
}
}
} else {
// Error Handling
}
}You must handle the getActions method in a Thread or AsyncTask. To update the main thread, you can use either Handler or runOnUiThread. This full code example uses Thread and Handler to update the main thread and change the UI.
// Add Context and Events
ProductThumbnailView productThumbnailView = new ProductThumbnailView();
productThumbnailView.setProducts(new String[]
{
"94",
"97",
"104"
});
PageView pageView = new PageView();
pageView.setPageType("Cartpage");
pageView.setUrl("https://www.monetate.com");
// addEvent
personalization.addEvent(EventTypes.ContextProductThumbnailView, productThumbnailView);
personalization.addEvent(EventTypes.ContextPageView, pageView);
// Get Social Proof Actions
// getActionsData
String responseData;
new Thread(new Runnable()
{
@Override
public void run()
{
// Gets the responseData using getActionsData
responseData = personalization.getActionsData(new String[]
{
"monetate:action:SocialProofDataV2"
}, true);
// Once you receive the responseData from getActionsData, use the Handler and parse the required data from it
new Handler(Looper.getMainLooper()).post(new Runnable()
{
@Override
public void run()
{
// Parse the received responseData, get the requiredData from it and use it accordingly
try
{
// Example: textView.setText(requiredData);
}
catch (Exception ex)
{
// Catch any exception that occurs while parsing
ex.printStackTrace();
}
}
});
}
}).start();Supported SDK Versions
- Android: 1.0.6-A or later
- React-Native: 1.0.6-RN or later
- Web: 1.0.6-W or later
- iOS: 2026.01.06 or later
let contextObj = ContextObj()
contextObj.addProductThumbnailsData(["PROD001", "PROD002", "PROD003"])
contextObj.addPageDetails(pageType: "PDP", path: "n/a", url: "n/a", categories: [], breadcrumbs: [])
objPersonalization.getActions(context: contextObj, arrActionTypes: ["monetate:action:SocialProofDataV2"], includeReporting: false)
.on(success: { (actions) in
self.handleSocialProof(actions: actions)
})
Context context = new Context();
context.addProductThumbnailsData(new String[] {"104", "94", "97"});
context.addPageDetails("Cartpage", "https://www.monetate.com", new String[] {"categories-here"},new String[] {"breadcrums--here"},"test/path");
personalization.getActions(context, new String[] {"monetate:action:SocialProofDataV2"}, false,new ActionsCallback() {
@Override
public void onSuccess(String actions) {
System.out.println("Action data :"+actions);
}
@Override
public void onError(Exception e) {
System.out.println("Ex :"+e);
}
});
const context = new Context();
context
.addProductThumbnailsData()
.product([
"prod_101",
"prod_102",
"prod_103"
]);
ontext
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));const context = new Context();
context
.addProductThumbnailsData()
.product([
"prod_101",
"prod_102",
"prod_103"
]);
ontext
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));This Social Proof type uses a recommendation strategy to determine and display a message on products the customer is most likely to purchase. You must add the ContextProductDetailView event.
// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductDetailView, {
products: [{productId: "94",sku: "sku"}],
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductDetailView, {
products: [{productId: "94",sku: "sku"}],
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
objPersonalization.addEvent(context: .ScreenSize, event: ScreenSize(height: 1000, width: 400))
objPersonalization.addEvent(context: .IpAddress, event: IPAddress(ipAddress: "192.168.1.52"))
objPersonalization.addEvent(
context: .ProductDetailView,
event: ProductDetailView(products: [Product(productId: "BackP_010", sku: "Blue_BackP_010")]))
// Get Social Proof Actions
// ----------------------------------------------------
objPersonalization.getActionsData(
requestId: "123456", includeReporting: false,
arrActionTypes: ["monetate:action:SocialProofDataV2"]
)
.on { res in
if res.status == 200 {
let data = JSON(res.data as Any)
for item in data["data"]["responses"].arrayValue {
if item["requestId"].string == res.requestId {
for socialProof in item["actions"].arrayValue {
self.handleSocialProofs(res: socialProof)
}
}
}
} else {
// Error Handling
}
}You must handle the getActions method in a Thread or AsyncTask. To update the main thread, you can use either Handler or runOnUiThread. This full code example uses Thread and Handler to update the main thread and change the UI.
// Add Context and Events
Product product1 = new Product();
product1.setProductId("97");
product1.setSku("SKU");
ProductDetailView productDetailView = new ProductDetailView();
productDetailView.setProducts(new Product[]
{
product1
});
PageView pageView = new PageView();
pageView.setPageType("Cartpage");
pageView.setUrl("https://www.monetate.com");
// addEvent
personalization.addEvent(EventTypes.ContextProductDetailView, productDetailView);
personalization.addEvent(EventTypes.ContextPageView, pageView);
// Get Social Proof Actions
// getActionsData
String responseData;
new Thread(new Runnable()
{
@Override
public void run()
{
// Gets the responseData using getActionsData
responseData = personalization.getActionsData(new String[]
{
"monetate:action:SocialProofDataV2"
}, true);
// Once you receive the responseData from getActionsData, use the Handler and parse the required data from it
new Handler(Looper.getMainLooper()).post(new Runnable()
{
@Override
public void run()
{
// Parse the received responseData, get the requiredData from it and use it accordingly
try
{
// Example: textView.setText(requiredData);
}
catch (Exception ex)
{
// Catch any exception that occurs while parsing
ex.printStackTrace();
}
}
});
}
}).start();Supported SDK Versions
- Android: 1.0.6-A or later
- React-Native: 1.0.6-RN or later
- Web: 1.0.6-W or later
- iOS: 2026.01.06 or later
let contextObj = ContextObj()
let productsSample = [
Product(productId: "PROD001", sku: "SKU001")
]
contextObj.addProductDetails(productsSample)
contextObj.addPageDetails(pageType: "PDP", path: "n/a", url: "n/a", categories: [], breadcrumbs: [])
objPersonalization.getActions(context: contextObj, arrActionTypes: ["monetate:action:SocialProofDataV2"], includeReporting: false)
.on(success: { (actions) in
self.handleSocialProof(actions: actions)
})
}
Context context = new Context();
context.addProductDetails(new Product[] {new Product("97", "sku")});
context.addPageDetails("Cartpage", "https://www.monetate.com", new String[] {"categories-here"},new String[] {"breadcrums--here"},"test/path");
personalization.getActions(context, new String[] {"monetate:action:SocialProofDataV2"}, false,new ActionsCallback() {
@Override
public void onSuccess(String actions) {
System.out.println("Action data :"+actions);
}
@Override
public void onError(Exception e) {
System.out.println("Ex :"+e);
}
});
const context = new Context();
context.
addProductDetails().
productId("123").
productSKU("SKU-123")
personalization.ProductDetails();
context
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));const context = new Context();
context.
addProductDetails().
productId("123").
productSKU("SKU-123")
personalization.ProductDetails();
context
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));This Social Proof type displays a message on products based on your current inventory, which may indicate that a product is popular due to limited inventory count. To target product detail pages, you must add the ContextProductDetailView event.
// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductDetailView, {
products: [{productId: "94",sku: "sku"}],
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductDetailView, {
products: [{productId: "94",sku: "sku"}],
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
objPersonalization.addEvent(context: .ScreenSize, event: ScreenSize(height: 1000, width: 400))
objPersonalization.addEvent(context: .IpAddress, event: IPAddress(ipAddress: "192.168.1.52"))
objPersonalization.addEvent(
context: .ProductDetailView,
event: ProductDetailView(products: [Product(productId: "BackP_010", sku: "Blue_BackP_010")]))
// Get Social Proof Actions
// ----------------------------------------------------
objPersonalization.getActionsData(
requestId: "123456", includeReporting: false,
arrActionTypes: ["monetate:action:SocialProofDataV2"]
)
.on { res in
if res.status == 200 {
let data = JSON(res.data as Any)
for item in data["data"]["responses"].arrayValue {
if item["requestId"].string == res.requestId {
for socialProof in item["actions"].arrayValue {
self.handleSocialProofs(res: socialProof)
}
}
}
} else {
// Error Handling
}
}You must handle the getActions method in a Thread or AsyncTask. To update the main thread, you can use either Handler or runOnUiThread. This full code example uses Thread and Handler to update the main thread and change the UI.
// Add Context and Events
Product product1 = new Product();
product1.setProductId("97");
product1.setSku("SKU");
ProductDetailView productDetailView = new ProductDetailView();
productDetailView.setProducts(new Product[]
{
product1
});
PageView pageView = new PageView();
pageView.setPageType("Cartpage");
pageView.setUrl("https://www.monetate.com");
// addEvent
personalization.addEvent(EventTypes.ContextProductDetailView, productDetailView);
personalization.addEvent(EventTypes.ContextPageView, pageView);
// Get Social Proof Actions
// getActionsData
String responseData;
new Thread(new Runnable()
{
@Override
public void run()
{
// Gets the responseData using getActionsData
responseData = personalization.getActionsData(new String[]
{
"monetate:action:SocialProofDataV2"
}, true);
// Once you receive the responseData from getActionsData, use the Handler and parse the required data from it
new Handler(Looper.getMainLooper()).post(new Runnable()
{
@Override
public void run()
{
// Parse the received responseData, get the requiredData from it and use it accordingly
try
{
// Example: textView.setText(requiredData);
}
catch (Exception ex)
{
// Catch any exception that occurs while parsing
ex.printStackTrace();
}
}
});
}
}).start();Supported SDK Versions
- Android: 1.0.6-A or later
- React-Native: 1.0.6-RN or later
- Web: 1.0.6-W or later
- iOS: 2026.01.06 or later
This Social Proof type displays a message on products based on your current inventory, which may indicate that a product is popular due to limited inventory count.
let contextObj = ContextObj()
let productsSample = [
Product(productId: "PROD001", sku: "SKU001")
]
contextObj.addProductDetails(productsSample)
contextObj.addPageDetails(pageType: "PDP", path: "n/a", url: "n/a", categories: [], breadcrumbs: [])
objPersonalization.getActions(context: contextObj, arrActionTypes: ["monetate:action:SocialProofDataV2"], includeReporting: false)
.on(success: { (actions) in
self.handleSocialProof(actions: actions)
})
}
Context context = new Context();
context.addProductDetails(new Product[] {new Product("97", "sku")});
context.addPageDetails("Cartpage", "https://www.monetate.com", new String[] {"categories-here"},new String[] {"breadcrums--here"},"test/path");
personalization.getActions(context, new String[] {"monetate:action:SocialProofDataV2"}, false,new ActionsCallback() {
@Override
public void onSuccess(String actions) {
System.out.println("Action data :"+actions);
}
@Override
public void onError(Exception e) {
System.out.println("Ex :"+e);
}
});const context = new Context();
context.
addProductDetails().
productId("123").
productSKU("SKU-123")
personalization.ProductDetails();
context
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));const context = new Context();
context.
addProductDetails().
productId("123").
productSKU("SKU-123")
personalization.ProductDetails();
context
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));This Social Proof type displays a message on products based on your current inventory, which may indicate that a product is product due to limited inventory count. To target page types that contain multiple product IDs—such as product category listings, search results pages, and cart pages—you must add the ProductThumbnailView event.
// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductThumbnailView, {
"products": ["90","91","92" ]
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
personalizationInstance.addEvent(EventTypes.ContextScreenSize, { width: 23, height: 34 });
personalizationInstance.addEvent(EventTypes.ContextIpAddress, {
ipAddress: "10.0.0.2",
});
personalizationInstance.addEvent(EventTypes.ContextProductThumbnailView, {
"products": ["90","91","92" ]
});
// Get Social Proof Actions
// ----------------------------------------------------
let socialProofData;
personalizationInstance
.getActionsData("monetate:action:OmniSocialProofDataV2")
.then(res => {
socialProofData = res[0].actions;
})
.catch(error => {
console.warn('Error!', error);
});// Add Context / Events
//-------------------------------------------------------------------------
objPersonalization.addEvent(context: .ScreenSize, event: ScreenSize(height: 1000, width: 400))
objPersonalization.addEvent(context: .IpAddress, event: IPAddress(ipAddress: "192.168.1.52"))
objPersonalization.addEvent(
context: .ProductThumbnailView,
event: ProductThumbnailView(products: Set(["BackP_010", "BackP_011"])))
// Get Social Proof Actions
// ----------------------------------------------------
objPersonalization.getActionsData(
requestId: "123456", includeReporting: false,
arrActionTypes: ["monetate:action:SocialProofDataV2"]
)
.on { res in
if res.status == 200 {
let data = JSON(res.data as Any)
for item in data["data"]["responses"].arrayValue {
if item["requestId"].string == res.requestId {
for socialProof in item["actions"].arrayValue {
self.handleSocialProofs(res: socialProof)
}
}
}
} else {
// Error Handling
}
}You must handle the getActions method in a Thread or AsyncTask. To update the main thread, you can use either Handler or runOnUiThread. This full code example uses Thread and Handler to update the main thread and change the UI.
// Add Context and Events
ProductThumbnailView productThumbnailView = new ProductThumbnailView();
productThumbnailView.setProducts(new String[]
{
"104",
"94",
"97"
});
PageView pageView = new PageView();
pageView.setPageType("Cartpage");
pageView.setUrl("https://www.monetate.com");
// addEvent
personalization.addEvent(EventTypes.ContextProductThumbnailView, productThumbnailView);
personalization.addEvent(EventTypes.ContextPageView, pageView);
// Get Social Proof Actions
// getActionsData
String responseData;
new Thread(new Runnable()
{
@Override
public void run()
{
// Gets the responseData using getActionsData
responseData = personalization.getActionsData(new String[]
{
"monetate:action:SocialProofDataV2"
}, true);
// Once you receive the responseData from getActionsData, use the Handler and parse the required data from it
new Handler(Looper.getMainLooper()).post(new Runnable()
{
@Override
public void run()
{
// Parse the received responseData, get the requiredData from it and use it accordingly
try
{
// Example: textView.setText(requiredData);
}
catch (Exception ex)
{
// Catch any exception that occurs while parsing
ex.printStackTrace();
}
}
});
}
}).start();
Supported SDK version
- Android: 1.0.6-A or later
- iOS: 2026.01.06 or later
let contextObj = ContextObj()
contextObj.addProductThumbnailsData(["PROD001", "PROD002", "PROD003"])
contextObj.addPageDetails(pageType: "PDP", path: "n/a", url: "n/a", categories: [], breadcrumbs: [])
objPersonalization.getActions(context: contextObj, arrActionTypes: ["monetate:action:SocialProofDataV2"], includeReporting: false)
.on(success: { (actions) in
self.handleSocialProof(actions: actions)
})
}
Context context = new Context();
context.addProductThumbnailsData(new String[] {"104", "94", "97"});
context.addPageDetails("Cartpage", "https://www.monetate.com", new String[] {"categories-here"},new String[] {"breadcrums--here"},"test/path");
personalization.getActions(context, new String[] {"monetate:action:SocialProofDataV2"}, false,new ActionsCallback() {
@Override
public void onSuccess(String actions) {
System.out.println("Action data :"+actions);
}
@Override
public void onError(Exception e) {
System.out.println("Ex :"+e);
}
});
const context = new Context();
context
.addProductThumbnailsData()
.product([
"prod_101",
"prod_102",
"prod_103"
]);
personalization.ProductDetails();
context
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));const context = new Context();
context.
addProductDetails().
productId("123").
productSKU("SKU-123")
personalization.ProductDetails();
context
.addPageDetails()
.url("www.monetate.com")
.path(monetate.com)
.pageType("home")
.breadcrumbs(["Home"])
.categories(["Homepage"]);
Personalization.getActions(
["monetate:action:OmnichannelJson"],
context)
.then((res: any) => console.log("Action === 1 res", res));