Target groups
With target groups it is possible to categorise anonymous visitors into segments. Once categorised your web site can be built to display different promotions and content to different target groups.
Implementing a custom target group condition
You can find a sample implementation of a custom target group condition here. The custom condition implemented in this sample is a referer condition. The condition checks if the referer contains a specific string.
The zip file contains the following files:
- TargetGroupReferrerFilterCondition.cs: The filter condtion object, which you can use to define your own fields.
- TargetGroupReferrerFilterServic.cs: Used to edit the TargetGroupReferrerFilterCondition object in back office.
- TargetGroupMapper.cs: Maps TargetGroupReferrerFilterCondition to TargetGroupFilterConditionModel.
- ReferrerCondition.cs: Processes the TargetGroupReferrerFilterCondition. Here you define how the condition will be applied. The condtion in this sample is applied only with a TargetEvent, since it is fired only when a new session is created. You need to browse from a referer so that the UrlReferrer has a value. So for testing you will need to delete browser session in order to see the condition trigger.
Use resource files in order to translate the label of your custom condtion shown in back office (see image below). Create your own resource files in the solution so that they will not be overwritten with future updates.

The sample custom referer condition looks like this in back office.

Possibility to see all current sessions related to a specific TargetGroup condition.
(Note: this implementation only works for InProc sessions)