2

I am working on Smart target implementation with DD4T. I have created a promotion for a particular page in CME through Targeting tab. When I was trying to get promotions through resultset it is showing empty value. When I remove page trigger from promotion it is returning in the promotion resultset. Below are the code snippet used to get promotions:

QueryBuilder querybuilder = new QueryBuilder("catalog01", "en-US", puburi, regions);
querybuilder.addCriteria(new PageCriteria("10-100-64"));
ClaimStore claimStore = AmbientDataContext.getCurrentClaimStore();
String triggers = AmbientDataHelper.getTriggers(claimStore);
querybuilder.parseQueryString(triggers);
ResultSet results = querybuilder.execute();

Here results.getPromotions() is returning empty value if I have promotion with page tcm id 10-100-64. If I remove the page from promotion it is returning in the resultset. Can anyone point to the probable issue. Thanks in advance..

  • What namespace is PageCriteria, the old regular Broker Criteria API? I don't think you can use that with the ST API. I'm surprised your code compiles. – Nickoli Roussakov Aug 16 '15 at 14:30
  • Hi Nickoli, namespace for page criteria is com.tridion.smarttarget.query.builder.PageCriteria. During creation of promotion we have the option to select page to show that promotion, so I was sure that it will work. In fredhopper too, I can see page id as a scope trigger. It is compiling but unfortunately not returning any promotions. – Mukesh Kumar Aug 16 '15 at 16:35
  • Have you tried to manually create the URL query string for the FH webservice and study the raw response? I recall Will Price had a few posts on how to do that. This would allow you to narrow down on the actual cause. – Nickoli Roussakov Aug 16 '15 at 20:09
  • Hi Nickoli, I have seen the difference between response returned for promotion with page trigger and without page trigger. And by analysing the response I can understand that fredhopper is not returning any promotion if page is defined for that promotion. I am not sure, if it is a default behaviour or something wrong with api call or configuration missing. – Mukesh Kumar Aug 17 '15 at 2:52
1

By analyzing the whole criteria through page preview of fredhopper I have found that page criteria was working fine with code mentioned. Only issue was with same name I had 2 pages and I have my promotions configured for wrong page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.