0

We are in the process of resetting up our Analytics on 8.2 Update 2. While reviewing logs, I noticed this error in the log that did not occur in our old 8.0 instance.

3084 08:49:45 INFO MARKETO: [Method: Marketo > GenerateCookie] [username: [email protected]]

3084 08:49:45 ERROR General error when submitting contact. Exception: System.NotImplementedException Message: The current data adapter provider does not support renumbering interactions. Source: Sitecore.Analytics.DataAccess at Sitecore.Analytics.DataAccess.DataAdapterProvider.RenumberInteractions(ID contactId) at Sitecore.Analytics.Data.ContactRepository.ReconcileContact(Contact contact, LeaseOwner owner, TimeSpan duration) at Sitecore.Analytics.Tracking.ContactManager.SubmitContact(Contact contact, ContactSaveOptions options, Contact& realContact)

3084 08:49:45 INFO MySite.Analytics.ContactManagement.TrackContact: Known contact identified: [email protected]

3084 08:49:45 INFO SITECORE ANALYTICS: Outcome added for contact: {F5A28B73-F58B-44F2-A011-4D76BB4984C9} for the definition: {52054874-4767-47DC-8099-8C08BFA307AA}

The code that appears to be raising this...

controller.Response.Cookies.Add(cookie);
Sitecore.Diagnostics.Log.Info("MARKETO: [Method: Marketo > GenerateCookie] [username: " + username + "]", this);

try
{
    ContactManagement contactManagement = new ContactManagement();
    bool trackedContact = contactManagement.TrackContact(username, true);
    bool updatedPreferred = contactManagement.UpdatePreferred(username);
    ThirdParty thirdParty = new ThirdParty();
    bool syncedThirdParty = thirdParty.Sync(username, "marketo");
}
catch (Exception ex)
{
    Sitecore.Diagnostics.Log.Error("MySite.BusinessLogic.Marketo.GenerateCookie (Analytics): [" + ex.StackTrace + "]", ex, this);
}
return true;

and...

public bool TrackContact(string identifier, bool addMarketingLead = false) {
    try
    {
        Tracker.Current.Session.Identify(identifier);
        var contact = Tracker.Current.Session.Contact;
        contact.ContactSaveMode = ContactSaveMode.AlwaysSave;
        if (contact.Identifiers.IdentificationLevel != ContactIdentificationLevel.Known)
        {
           contact.Identifiers.IdentificationLevel = ContactIdentificationLevel.Known;
        }
        Log.Info("MySite.Analytics.ContactManagement.TrackContact: Known contact identified: " + identifier, this);
        if (addMarketingLead == true) 
        {
            bool addedMarketingLeadOutcome = new Outcomes().AddMarketingLead(contact.ContactId);
        }
        return true;
    }
    catch (Exception ex)
    {
        Log.Error("MySite.Analytics.ContactManagement.TrackContact: [" + ex.StackTrace + "]", ex, this);
        return false;
    }
}

You will see that we log that the cookie was created okay, then we log that the Known contact has been identified. So the error appears to be occurring between those two Log.Info calls.

Any ideas why this error about renumbering interactions is now being raised?

1 Answer 1

1

After some investigation in Sitecore.Analytics.dll and Sitecore.Analytics.DataAccess.dll I found that it is called by the Tracker.Current.Session.Identify method. So actually the stacktrace is:

  1. Sitecore.Analytics.Tracking.ContactManager.FlushContactToXdb(Contact contact)
  2. Sitecore.Analytics.Tracking.ContactManager.SubmitContact(Contact contact, ContactSaveOptions options, Contact& realContact) ...

This method was totally different in Sitecore 8.0.

So at the end the RenumberInteractions(ID contactId) throws the exception.

public virtual void RenumberInteractions(ID contactId)
{
  throw new NotImplementedException("The current data adapter provider does not support renumbering interactions.");
}

I tested locally on a clean instance and I don't have this error so maybe setting is different. I think somehow the contact.IsTemporaryInstance is true. And that's why it is going to that branch. I suggest to decompile the these 2 assemblies and check what happens there. Especailly I am talking about the Tracker.Current.Session.Identify(string userName) method. Something happens in this branch I guess:

if (contact1 == null || contact1.ContactId == Guid.Empty)
  {
    bool flag = false;
    if (this.Contact.Identifiers.IdentificationLevel != ContactIdentificationLevel.Known)
    {
      if (this.Contact.ContactSaveMode != ContactSaveMode.NeverSave && !this.Settings.IsTransient && (ContactClassification.IsHuman(this.Contact.System.Classification) || ContactClassification.IsAutoDetectedRobot(this.Contact.System.Classification)))
      {
        if (this.Contact.System.VisitCount > 1)
          contact1 = contactManager.LoadContactReadOnly(this.Contact.ContactId);
        if (contact1 == null)
        {
          contact1 = contactManager.CreateContact(this.Contact.ContactId);
          contact1.IsTemporaryInstance = true;
        }
        flag = true;
      }
      else
        contact1 = this.Contact;
    }
    else
    {
      flag = true;
      ID id = string.Equals(this.Contact.Identifiers.Identifier, userName, StringComparison.InvariantCultureIgnoreCase) ? TypeExtensions.ToID(this.Contact.ContactId) : ID.NewID;
      contact1 = contactManager.CreateContact(id);
    }
    contact1.Identifiers.IdentificationLevel = ContactIdentificationLevel.Known;
    contact1.Identifiers.Identifier = userName;
    if (flag)
      contactManager.FlushContactToXdb(contact1);
  }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.