Skip to main content
Bumped by Community user
Formatting improvements
Source Link
Marcel Gruber
  • 2.2k
  • 1
  • 18
  • 38
try
        {
            //Identify the user
            Tracker.Current.Session.Identify(model.Email);

            //get the contact
            var contact = Tracker.Current.Session.Contact;

            if (contact != null)
            {
                //Update contact
                SitecoreContactManager.UpdateXdbContact(model.Email, model.FirstName, model.LastName, model.Phone);
            }
            else
            {
                //Create contact
                Tracker.Current.Session.Contact = SitecoreContactManager.GetXdbContact(model.Email);
            }
        }
        catch (Exception exception)
        {
            Sitecore.Diagnostics.Log.Error($"error in creating or updating contact for identifier {model.Email}", exception, this);
        }
try
{
    //Identify the user
    Tracker.Current.Session.Identify(model.Email);

    //Get the contact
    var contact = Tracker.Current.Session.Contact;

    if (contact != null)
    {
        //Update contact
        SitecoreContactManager.UpdateXdbContact(model.Email, model.FirstName, model.LastName, model.Phone);
    }
    else
    {
        //Create contact
        Tracker.Current.Session.Contact = SitecoreContactManager.GetXdbContact(model.Email);
    }
}
catch (Exception exception)
{
    Sitecore.Diagnostics.Log.Error($"error in creating or updating contact for identifier {model.Email}", exception, this);
}
  • I have checked the connections to mongo databases(I can see data in there)
  • I have rebuild reporting database.
  • compared the Sitecore/admin/showconfig.aspx /admin/showconfig.aspx of DEV and LIVE, I could not able to see anything obvious.
try
        {
            //Identify the user
            Tracker.Current.Session.Identify(model.Email);

            //get the contact
            var contact = Tracker.Current.Session.Contact;

            if (contact != null)
            {
                //Update contact
                SitecoreContactManager.UpdateXdbContact(model.Email, model.FirstName, model.LastName, model.Phone);
            }
            else
            {
                //Create contact
                Tracker.Current.Session.Contact = SitecoreContactManager.GetXdbContact(model.Email);
            }
        }
        catch (Exception exception)
        {
            Sitecore.Diagnostics.Log.Error($"error in creating or updating contact for identifier {model.Email}", exception, this);
        }
  • I have checked the connections to mongo databases(I can see data in there)
  • I have rebuild reporting database.
  • compared the Sitecore/admin/showconfig.aspx of DEV and LIVE, I could not able to see anything obvious.
try
{
    //Identify the user
    Tracker.Current.Session.Identify(model.Email);

    //Get the contact
    var contact = Tracker.Current.Session.Contact;

    if (contact != null)
    {
        //Update contact
        SitecoreContactManager.UpdateXdbContact(model.Email, model.FirstName, model.LastName, model.Phone);
    }
    else
    {
        //Create contact
        Tracker.Current.Session.Contact = SitecoreContactManager.GetXdbContact(model.Email);
    }
}
catch (Exception exception)
{
    Sitecore.Diagnostics.Log.Error($"error in creating or updating contact for identifier {model.Email}", exception, this);
}
  • I have checked the connections to mongo databases(I can see data in there)
  • I have rebuild reporting database.
  • compared the Sitecore /admin/showconfig.aspx of DEV and LIVE, I could not able to see anything obvious.
Mod Moved Comments To Chat
added 48 characters in body
Source Link

When a user submits's a form on the contact us page, I am creating a contact in xDB as:

try
        {
            //Identify the user
            Tracker.Current.Session.Identify(model.Email);

            //get the contact
            var contact = Tracker.Current.Session.Contact;

            if (contact != null)
            {
                //Update contact
                SitecoreContactManager.UpdateXdbContact(model.Email, model.FirstName, model.LastName, model.Phone);
            }
            else
            {
                //Create contact
                Tracker.Current.Session.Contact = SitecoreContactManager.GetXdbContact(model.Email);
            }
        }
        catch (Exception exception)
        {
            Sitecore.Diagnostics.Log.Error($"error in creating or updating contact for identifier {model.Email}", exception, this);
        }

this works well locally and on DEV but in live, it is throwing an error as :

Exception: System.InvalidOperationException Message: this.Interaction should not be null Source: Sitecore.Analytics at Sitecore.Analytics.Tracking.StandardSession.Identify(String userName) at uk.co.biggroup.www.api.ContactFormController.CreateUpdateContactInXdb(FormDetailsModel model)

  • I have checked the connections to mongo databases(I can see data in there)
  • I have rebuild reporting database.
  • compared the Sitecore/admin/showconfig.aspx of DEV and LIVE, I could not able to see anything obvious.

Sitecore version: 8.2 rev. 170614 (Update-4)

Did anyone experience this issue before?

When a user submits's a form on the contact us page, I am creating a contact in xDB as:

try
        {
            //Identify the user
            Tracker.Current.Session.Identify(model.Email);

            //get the contact
            var contact = Tracker.Current.Session.Contact;

            if (contact != null)
            {
                //Update contact
                SitecoreContactManager.UpdateXdbContact(model.Email, model.FirstName, model.LastName, model.Phone);
            }
            else
            {
                //Create contact
                Tracker.Current.Session.Contact = SitecoreContactManager.GetXdbContact(model.Email);
            }
        }
        catch (Exception exception)
        {
            Sitecore.Diagnostics.Log.Error($"error in creating or updating contact for identifier {model.Email}", exception, this);
        }

this works well locally and on DEV but in live, it is throwing an error as :

Exception: System.InvalidOperationException Message: this.Interaction should not be null Source: Sitecore.Analytics at Sitecore.Analytics.Tracking.StandardSession.Identify(String userName) at uk.co.biggroup.www.api.ContactFormController.CreateUpdateContactInXdb(FormDetailsModel model)

  • I have checked the connections to mongo databases(I can see data in there)
  • I have rebuild reporting database.
  • compared the Sitecore/admin/showconfig.aspx of DEV and LIVE, I could not able to see anything obvious.

Did anyone experience this issue before?

When a user submits's a form on the contact us page, I am creating a contact in xDB as:

try
        {
            //Identify the user
            Tracker.Current.Session.Identify(model.Email);

            //get the contact
            var contact = Tracker.Current.Session.Contact;

            if (contact != null)
            {
                //Update contact
                SitecoreContactManager.UpdateXdbContact(model.Email, model.FirstName, model.LastName, model.Phone);
            }
            else
            {
                //Create contact
                Tracker.Current.Session.Contact = SitecoreContactManager.GetXdbContact(model.Email);
            }
        }
        catch (Exception exception)
        {
            Sitecore.Diagnostics.Log.Error($"error in creating or updating contact for identifier {model.Email}", exception, this);
        }

this works well locally and on DEV but in live, it is throwing an error as :

Exception: System.InvalidOperationException Message: this.Interaction should not be null Source: Sitecore.Analytics at Sitecore.Analytics.Tracking.StandardSession.Identify(String userName) at uk.co.biggroup.www.api.ContactFormController.CreateUpdateContactInXdb(FormDetailsModel model)

  • I have checked the connections to mongo databases(I can see data in there)
  • I have rebuild reporting database.
  • compared the Sitecore/admin/showconfig.aspx of DEV and LIVE, I could not able to see anything obvious.

Sitecore version: 8.2 rev. 170614 (Update-4)

Did anyone experience this issue before?

added 41 characters in body
Source Link

When a user submits's a form on the contact us page, I am creating a contact in xDB as:

try
        {
            //Identify the user
            Tracker.Current.Session.Identify(model.Email);

            //get the contact
            var contact = Tracker.Current.Session.Contact;

            if (contact != null)
            {
                //Update contact
                SitecoreContactManager.UpdateXdbContact(model.Email, model.FirstName, model.LastName, model.Phone);
            }
            else
            {
                //Create contact
                Tracker.Current.Session.Contact = SitecoreContactManager.GetXdbContact(model.Email);
            }
        }
        catch (Exception exception)
        {
            Sitecore.Diagnostics.Log.Error($"error in creating or updating contact for identifier {model.Email}", exception, this);
        }

this works well locally and on DEV but in live, it is throwing an error as :

Exception: System.InvalidOperationException Message: this.Interaction should not be null Source: Sitecore.Analytics at Sitecore.Analytics.Tracking.StandardSession.Identify(String userName) at uk.co.biggroup.www.api.ContactFormController.CreateUpdateContactInXdb(FormDetailsModel model)

I have checked the connections to mongo databases and compared the Sitecore/admin/showconfig.aspx, I could not able to see anything obvious.

  • I have checked the connections to mongo databases(I can see data in there)
  • I have rebuild reporting database.
  • compared the Sitecore/admin/showconfig.aspx of DEV and LIVE, I could not able to see anything obvious.

Did anyone experience this issue before?

When a user submits's a form on the contact us page, I am creating a contact in xDB as:

try
        {
            //Identify the user
            Tracker.Current.Session.Identify(model.Email);

            //get the contact
            var contact = Tracker.Current.Session.Contact;

            if (contact != null)
            {
                //Update contact
                SitecoreContactManager.UpdateXdbContact(model.Email, model.FirstName, model.LastName, model.Phone);
            }
            else
            {
                //Create contact
                Tracker.Current.Session.Contact = SitecoreContactManager.GetXdbContact(model.Email);
            }
        }
        catch (Exception exception)
        {
            Sitecore.Diagnostics.Log.Error($"error in creating or updating contact for identifier {model.Email}", exception, this);
        }

this works well locally and on DEV but in live, it is throwing an error as :

Exception: System.InvalidOperationException Message: this.Interaction should not be null Source: Sitecore.Analytics at Sitecore.Analytics.Tracking.StandardSession.Identify(String userName) at uk.co.biggroup.www.api.ContactFormController.CreateUpdateContactInXdb(FormDetailsModel model)

I have checked the connections to mongo databases and compared the Sitecore/admin/showconfig.aspx, I could not able to see anything obvious.

Did anyone experience this issue before?

When a user submits's a form on the contact us page, I am creating a contact in xDB as:

try
        {
            //Identify the user
            Tracker.Current.Session.Identify(model.Email);

            //get the contact
            var contact = Tracker.Current.Session.Contact;

            if (contact != null)
            {
                //Update contact
                SitecoreContactManager.UpdateXdbContact(model.Email, model.FirstName, model.LastName, model.Phone);
            }
            else
            {
                //Create contact
                Tracker.Current.Session.Contact = SitecoreContactManager.GetXdbContact(model.Email);
            }
        }
        catch (Exception exception)
        {
            Sitecore.Diagnostics.Log.Error($"error in creating or updating contact for identifier {model.Email}", exception, this);
        }

this works well locally and on DEV but in live, it is throwing an error as :

Exception: System.InvalidOperationException Message: this.Interaction should not be null Source: Sitecore.Analytics at Sitecore.Analytics.Tracking.StandardSession.Identify(String userName) at uk.co.biggroup.www.api.ContactFormController.CreateUpdateContactInXdb(FormDetailsModel model)

  • I have checked the connections to mongo databases(I can see data in there)
  • I have rebuild reporting database.
  • compared the Sitecore/admin/showconfig.aspx of DEV and LIVE, I could not able to see anything obvious.

Did anyone experience this issue before?

Source Link
Loading