8

What is the accepted method of preventing a contact from registering an outcome multiple times? For example, if they become a "Marketing Lead", how do I prevent that Outcome from firing again for that contact?

Do you need to programmatically check to see if the outcome has already been registered for the contact? Or is there a configuration setting for this?

I see the "Ignore Additional Registrations" checkbox, but I am not sure what it does.

I am using Sitecore 8.1 Update 2 with xDB Cloud.

4

You are correct—the "Ignore Additional Registrations" checkbox will make sure that nothing happens in case an existing outcome is attempted to be registered again.

Here's an excerpt from the decompiled class Sitecore.Analytics.Outcome.OutcomeManager:

public virtual void Save(IOutcome outcome)
{
  if (!this.CanSaveOutcome(outcome))
  {
    return;
  }

  this.repository.Save(outcome);
}

private bool CanSaveOutcome(IOutcome outcome)
{
  IDefinitionManager<IOutcomeDefinition> definitionManager =
    DefinitionManagerFactory.Default.GetDefinitionManager<IOutcomeDefinition>(null);

  IOutcomeDefinition outcomeDefinition =
    definitionManager.Get(outcome.DefinitionId, CultureInfo.InvariantCulture);

  return
    outcomeDefinition == null
    || !outcomeDefinition.AdditionalRegistrationsAreIgnored
    || !this.HasOutcome(outcome.EntityId, outcome.DefinitionId);
}

As you can see, OutcomeManager.Save() will only register the outcome if the checkbox "Ignore Additional Registrations" is unchecked, or if the outcome has not been registered yet.

As a side note, it's quite interesting that the outcome will be saved successfully even if you specify a non-existing outcome definition ID in outcome.DefinitionId.

|improve this answer|||||
  • Interestingly, it won't let me check the box. When I check it, and click save it just flashes the screen and the box isn't checked. I can save a change to the Marketing Lead name, but not that checkbox. It seems I can't change that value for any of the built in Outcomes? – eat-sleep-code Oct 5 '16 at 16:53
  • @eat-sleep-code That's interesting. Could you please create a separate question about this issue? – Dmytro Shevchenko Oct 5 '16 at 18:29
  • I have created a separate question on this complete with the error that seems to get written to the log. Thanks! – eat-sleep-code Oct 5 '16 at 18:51
  • 1
    A tad bit late: but there is an existing bug in 8.1 update 2 that prevents the box from being checked. Sitecore released a hotfix for it: (reference number 128651) – Bas Lijten May 14 '17 at 15:21

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.