I created a segment which shows me the message `Data loaded in the Client Context do not resolve the current segment.` Below is Code :
if (!CQ_Analytics.CCSFDataMgr) {
CQ_Analytics.CCSFDataMgr = new CQ_Analytics.SessionStore();
CQ_Analytics.CCSFDataMgr.STORENAME = "ccsfprofile";
CQ_Analytics.CCSFDataMgr.STOREKEY = "CCSF";
alert(CQ_Analytics.CCSFDataMgr.data);
CQ_Analytics.CCSFDataMgr.data={"Name":"Amit"};
CQ_Analytics.CCSFDataMgr.loadData = function(){
//here would be ajax call to get gata
CQ_Analytics.CCSFDataMgr.data={"Name":"Amit"};
};
if(CQ_Analytics.ClientContextMgr) {
CQ_Analytics.ClientContextMgr.register(CQ_Analytics.CCSFDataMgr);
}
CQ_Analytics.CCM.addListener("configloaded", function() {
CQ_Analytics.CCSFDataMgr.addListener("initialize", function() {
this.loadData();
});
}, CQ_Analytics.CCSFDataMgr);
CQ_Analytics.CCSFDataMgr.initialized = false;
}
If i set CQ_Analytics.CCSFDataMgr.data outside loadData() function, Segment Rules get resolve, but if I set it inside loadData() it doesn't resolve segment rule.
Below is init.js.jsp
<%
String leadAddress = properties.get("email", String.class);
log.info("leadAddress ---> "+leadAddress);
if(leadAddress != null && !leadAddress.equalsIgnoreCase("")) {
%>
if(CQ_Analytics && CQ_Analytics.CCSFDataMgr){
alert("init.js.jsp");
CQ_Analytics.CCSFDataMgr.EMAILID ="<%=leadAddress%>";
CQ_Analytics.CCSFDataMgr.init();
}
<% } %>
Thanks.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi vdhim23,
There is an issue where segmentation won't work if the component isn't already loaded. See http://blogs.adobe.com/aemtutorials/2013/07/24/customize-the-client-context/
Hope that helps.
Regards,
Alva
Views
Replies
Total Likes
Hi vdhim23,
There is an issue where segmentation won't work if the component isn't already loaded. See http://blogs.adobe.com/aemtutorials/2013/07/24/customize-the-client-context/
Hope that helps.
Regards,
Alva
Views
Replies
Total Likes