2

I can see the promotions are getting filtered out based on triggers properly in QueryServer and Indexer Server Preview mode, but when I am trying fetch the Promotion using SmartTarget API, I am getting no promotions in resultset.

I have created Custom dummy Cartridge for location claim. I am using Keyword based trigger for location in SmartTarget and also configured in TriggerType.xml in Fredhopper. For testing I have hard coded the TCM URI of location Keyword I have selected in SmartTarget Promotion.

Below is code snippet I am using for SmartTarget API

Util.TcmUri pageUri = new Util.TcmUri(String.Format("tcm:{0}-{1}-64", localization.LocalizationId, smartTargetPageModel.Id));
Util.TcmUri publicationUri = new Util.TcmUri(0, pageUri.PublicationId, 1);

ClaimStore claimStore = AmbientDataContext.CurrentClaimStore;
var locationClaim = claimStore.Get<string>(new Uri("taf:claim:ambientdata:locationcartridge:userlocation"));
string locationId = "tcm:28-695-1024";

if (locationClaim == null)
{
    claimStore.Put(new Uri("taf:claim:ambientdata:locationcartridge:userlocation"), locationId, global::Tridion.ContentDelivery.AmbientData.Runtime.ClaimType.Normal, global::Tridion.ContentDelivery.AmbientData.Runtime.ClaimValueScope.Session);
}

string triggers = AmbientDataHelper.GetTriggers(claimStore);

QueryBuilder queryBuilder = new QueryBuilder();
queryBuilder.AddCriteria(new PublicationCriteria(publicationUri));
queryBuilder.AddCriteria(new PageCriteria(pageUri));                
queryBuilder.AddCriteria(new RegionCriteria("Offers"));
queryBuilder.Parse(triggers);

return queryBuilder.Execute();

Please note that I have added Query Service capability in Content Discovery service and I am not using TCDL tags in presentation site. In log file of query service, I am not getting error but it does not show that query server is getting called, only getting below log in smart-target log file of query service.

2017-05-23 06:24:41,804 INFO WebServiceExecutor - Trigger-Types are successfully retrieved. Response status code: 200

2017-05-23 06:24:42,039 INFO WebServiceExecutor - trigger-types are successfully retrieved

2017-05-23 06:44:14,020 INFO ConfigurationUtility - Loading Mappings for Publications

2017-05-23 06:44:16,763 DEBUG QueryEntityRegister - Registering entity data models

2017-05-23 07:03:40,954 DEBUG TriggerTypeDataSourceProvider - SelectOperation: Getting all trigger types.

2017-05-23 07:03:40,995 INFO WebServiceExecutor - Trigger-Types are successfully retrieved. Response status code: 200

2017-05-23 07:03:41,200 INFO WebServiceExecutor - trigger-types are successfully retrieved

2017-05-23 07:07:48,533 DEBUG TriggerTypeDataSourceProvider - SelectOperation: Getting all trigger types.

2017-05-23 07:07:48,541 INFO WebServiceExecutor - Trigger-Types are successfully retrieved. Response status code: 200

2017-05-23 07:07:48,545 INFO WebServiceExecutor - trigger-types are successfully retrieved

2017-05-23 07:07:57,177 DEBUG TriggerTypeDataSourceProvider - SelectOperation: Getting all trigger types.

2017-05-23 07:07:57,186 INFO WebServiceExecutor - Trigger-Types are successfully retrieved. Response status code: 200

2017-05-23 07:07:57,191 INFO WebServiceExecutor - trigger-types are successfully retrieved

  • Please edit your question and include the query you are doing -- either through the source code or a debug log entry. – Peter Kjaer May 23 '17 at 10:12
  • That code seems alright. If you do a queryBuilder.ToString() does it still include the Publication, Page, and Region criteria? Also, the fact that it doesn't seem to call the query server is very suspicious -- are you sure it's not going to another instance than the one you expected? – Peter Kjaer May 23 '17 at 14:25
  • Query service capability is configured on port 8094 in Content deployer server. And this 8094 port is not accessible outside. Does it needs to be opened for the location from where I am executing this code. – somen mondal May 23 '17 at 16:33
  • 1
    Yes it does. BTW: I'm confused by the DXA-1.7 tag. Is your Web Application DXA-based? If so, have you considered using the DXA Experience Optimization Module? – Rick Pannekoek May 23 '17 at 16:51
  • Yes it is web application dxa based and using dd4t. – somen mondal May 23 '17 at 18:40
1

Thank you all, I am able to the promotion once port 8094 for query service get opened for presentation server

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.