We want to match visitors to pattern cards based on all visits they've made, not just the current visit. The Segment Builder rule "Matches Pattern" is:
where the visitor matches the [PatternName,Pattern,selectprofilefirst=1&resulttype=Name,specific] pattern card in the [ProfileName,Profile,resulttype=Name,specific] profile
This is from
Sitecore.Analytics.Rules.SegmentBuilder.Conditions.HasPatternCondition,Sitecore.SegmentBuilder
Is it possible to add this to the available personalisation rules a page editor can choose for a component, and to have it evaluated at runtime?
Sitecore.NET 7.2 (rev. 140526)
The Segment Builder rules are designed to match large collections of existing visitors based on your criteria. If you inspect the code for any of the Segment Builder conditions, you'll see that they build up a clause that is eventually executed against the Visitors table.
You are right about the OOTB Conditional Rendering rule only matching Pattern Cards for the current visit. Thankfully, it's pretty easy to extend the rule to include profiles across all visits:
The
LoadAll()
method will load all of visitor's profiles into the current DataSet. We then call the baseExecute()
method which checks the DataSet for matching Pattern Cards.