I am using Sitecore 9.0.2, I am using a custom Update Contact
submit action in forms to update facet in xDB. Now before updating contact in xDB, I want to check that if user is Robot
or not, so for that I have checked Sitecore.Analytics.Pipelines.CommitSession.Robots
processor, it is using ContactClassification.IsRobot
function and passing if args.Session.Contact.System.Classification
parameter. Below is code:
public class Robots : CommitSessionProcessor
{
public override void Process(CommitSessionPipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
Assert.IsNotNull(args.Session.Contact, "args.Context.Contact should not be null");
if (ContactClassification.IsRobot(args.Session.Contact.System.Classification) && AnalyticsSettings.Robots.IgnoreRobots)
{
ContactManager expr_58 = Assert.ResultNotNull<ContactManager>(Factory.CreateObject("tracking/contactManager", true) as ContactManager);
expr_58.SaveContactToCollectionDb(args.Session.Contact);
expr_58.RemoveFromSession(args.Session.Contact.ContactId);
Log.Debug("[Analytics]: The CommitSession pipeline was aborted. Visit was classified as robot and visits made by robots are configured to be ignored.", this);
args.AbortPipeline();
}
}
}
<processor type="Sitecore.Analytics.Pipelines.CommitSession.Robots, Sitecore.Analytics" patch:source="Sitecore.Analytics.Tracking.Database.config"/>
I am trying to use same function on UpdateContact
but I am not sure what parameter I need to pass in IsRobot
function. Below is my submit action:
public class UpdateContact : SubmitActionBase<UpdateContactData>
{
public UpdateContact(ISubmitActionData submitActionData) : base(submitActionData)
{
}
protected override bool Execute(UpdateContactData data, FormSubmitContext formSubmitContext)
{
}
}
Can anybody suggest me what parameter I need to pass instead of args.Session.Contact.System.Classification
?