Hi,
The OOTB script trait allows us to write script while creating segmentation rules. This has to be boolean expression. When we add a Javascript function to script block like below.
(function (){
var myFirstVar = "Test";
var mySecondVar = "Test1"
if (orderType == "Test" && deviceSKU == "Test1"){
return true;
}
})();
The segmentation editor shows the green highlighted background that segment is resolved. But when we access the main page in which teaser component is referring to a campaign linked to above segment with Javascript function, the segment is not getting resolved. If we add just boolean expression, the segment resolves fine in main page.
Is it possible to write Javascript function inside Script trait (so that we can perform more logic)? If so is there a correct way to do this so that main page resolves the segment.
Regards,
Sandeep
Solved! Go to Solution.
Views
Replies
Total Likes
Removing colon (;) at the end of function works. Following works
(function (){
var myFirstVar = "Test";
var mySecondVar = "Test1"
if (orderType == "Test" && deviceSKU == "Test1"){
return true;
}
})()
Thanks,
Sandeep
Views
Replies
Total Likes
Which product are your talking here? Adobe Target or Target engine in AEM?
Views
Replies
Total Likes
This is for Target engine in AEM
Views
Replies
Total Likes
Removing colon (;) at the end of function works. Following works
(function (){
var myFirstVar = "Test";
var mySecondVar = "Test1"
if (orderType == "Test" && deviceSKU == "Test1"){
return true;
}
})()
Thanks,
Sandeep
Views
Replies
Total Likes
Views
Like
Replies
Views
Likes
Replies