0
votes

I added personalization rule in my Sitecore site - "Where the gender of the current contact is Male", but I can't figure out how to set "Visitors settings" to test it.

I'll be very grateful if someone can help me with this.

Thanks in advance!

1
Where do you have the gender coming from? Is that extended user profile? Also what is your Sitecore version? - Martin Miles
I added this condition using Device Editor -> Controls -> Personalization, then I selected that gender condition from the conditions list. My current Sitecore version is 8. Tnaks in advance! - Bube

1 Answers

0
votes

The only Gender condition I found in default Sitecore 8 installation is the one coming from Social module (that is now built-in) located at /sitecore/system/Settings/Rules/Definitions/Macros/Social/Gender in Sitecore tree. Looking up its code I see the following code:

protected override bool Execute(T ruleContext)
{
  if (!AnalyticsSettings.Enabled || Tracker.Current == null || Tracker.Current.Contact == null)
    return false;
  return string.Equals(this.GenderValue, ((IGenderConditionManager) ResolutionExtensions.Get<IGenderConditionManager>((IResolutionRoot) ExecutingContext.Current.IoC, new IParameter[0])).GetGender(GuidExtensions.GetIdentifier(Tracker.Current.Contact.ContactId)).ToString(), StringComparison.OrdinalIgnoreCase);
}

From the code above we can see that to make Gender condition work, you should have analytics and tracking up and running. So if you have that enabled - ensure all settings are correct and it works indeed.

User membership provider does not have gender settings by itself; so the rule condition above can take it only from tracking.